Patch Glib

Luana C. Rocha luanac.rocha at gmail.com
Wed Sep 15 20:42:21 UTC 2010


  Hi,

I'm new linux user and I need do patch my glib in order to make
pacemaker-gui to work.
I know that i have to apply the following
patch: http://git.gnome.org/browse/glib/commit/?
id=bf2719c815d719d1899b4bdb1b81ff6798471094, but i don't know how to do it.


I tried to do these steps, but didn't work. Can someone give me a
detailed tutorial about how to apply patchs, or point me what i did
wrong?

I've copy the content of the patch to a file named patch:

---a/glib/gatomic.h
+++b/glib/gatomic.h
@@ -64,16  64,16 @@ void     g_atomic_pointer_set
(volatile gpointer G_GNUC_MAY_ALI
  #else
  # define g_atomic_int_get(atomic) \
   ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]),
\
-  (g_atomic_int_get) ((volatile gint G_GNUC_MAY_ALIAS *) (void *)
(atomic)))
    (g_atomic_int_get) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void
*) (atomic)))
  # define g_atomic_int_set(atomic, newval) \
   ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]),
\
-  (g_atomic_int_set) ((volatile gint G_GNUC_MAY_ALIAS *) (void *)
(atomic), (newval)))
    (g_atomic_int_set) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void
*) (atomic), (newval)))
  # define g_atomic_pointer_get(atomic) \
   ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -
1]), \
-  (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (void
*) (atomic)))
    (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *)
(volatile void *) (atomic)))
  # define g_atomic_pointer_set(atomic, newval) \
   ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -
1]), \
-  (g_atomic_pointer_set) ((volatile gpointer G_GNUC_MAY_ALIAS *) (void
*) (atomic), (newval)))
    (g_atomic_pointer_set) ((volatile gpointer G_GNUC_MAY_ALIAS *)
(volatile void *) (atomic), (newval)))
  #endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */

  #define g_atomic_int_inc(atomic) (g_atomic_int_add ((atomic), 1))



Then I execute the commands:

diff -uN /usr/include/glib-2.0/glib/gatomic.h /home/luana/patch > glib.patch

patch glib.patch

But didn't solve my problem.
In fact the system "freezes" and looks like the patch wasn't applied.

Thank You.

LCR




More information about the ubuntu-users mailing list