Always export g_atomic_int_get and g_atomic_pointer_get as functions, even
authorMatthias Clasen <mclasen@redhat.com>
Thu, 4 Aug 2005 17:21:03 +0000 (17:21 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 4 Aug 2005 17:21:03 +0000 (17:21 +0000)
2005-08-04  Matthias Clasen  <mclasen@redhat.com>

* glib/glib.symbols:
* glib/gatomic.[hc]: Always export g_atomic_int_get and
g_atomic_pointer_get as functions, even if we have macros,
to avoid changing the ABI depending on configuration.

* glib/gatomic.c: Fix the s390 implementations of
g_atomic_pointer_compare_and_exchange.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-8
glib/gatomic.c
glib/gatomic.h
glib/glib.symbols

index 2cc8fcced4a28c1fa3b6943bfdd42c3743d52d02..d5fb2af8855806273e952c44e50b0e4355c4159e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-08-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/glib.symbols:
+       * glib/gatomic.[hc]: Always export g_atomic_int_get and
+       g_atomic_pointer_get as functions, even if we have macros,
+       to avoid changing the ABI depending on configuration.
+       
+       * glib/gatomic.c: Fix the s390 implementations of 
+       g_atomic_pointer_compare_and_exchange.
+
 2005-08-04  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.h: Move the G_BEGIN_DECLS/G_END_DECLS pair outside
index 2cc8fcced4a28c1fa3b6943bfdd42c3743d52d02..d5fb2af8855806273e952c44e50b0e4355c4159e 100644 (file)
@@ -1,3 +1,13 @@
+2005-08-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/glib.symbols:
+       * glib/gatomic.[hc]: Always export g_atomic_int_get and
+       g_atomic_pointer_get as functions, even if we have macros,
+       to avoid changing the ABI depending on configuration.
+       
+       * glib/gatomic.c: Fix the s390 implementations of 
+       g_atomic_pointer_compare_and_exchange.
+
 2005-08-04  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.h: Move the G_BEGIN_DECLS/G_END_DECLS pair outside
index 2cc8fcced4a28c1fa3b6943bfdd42c3743d52d02..d5fb2af8855806273e952c44e50b0e4355c4159e 100644 (file)
@@ -1,3 +1,13 @@
+2005-08-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/glib.symbols:
+       * glib/gatomic.[hc]: Always export g_atomic_int_get and
+       g_atomic_pointer_get as functions, even if we have macros,
+       to avoid changing the ABI depending on configuration.
+       
+       * glib/gatomic.c: Fix the s390 implementations of 
+       g_atomic_pointer_compare_and_exchange.
+
 2005-08-04  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.h: Move the G_BEGIN_DECLS/G_END_DECLS pair outside
index 2cc8fcced4a28c1fa3b6943bfdd42c3743d52d02..d5fb2af8855806273e952c44e50b0e4355c4159e 100644 (file)
@@ -1,3 +1,13 @@
+2005-08-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/glib.symbols:
+       * glib/gatomic.[hc]: Always export g_atomic_int_get and
+       g_atomic_pointer_get as functions, even if we have macros,
+       to avoid changing the ABI depending on configuration.
+       
+       * glib/gatomic.c: Fix the s390 implementations of 
+       g_atomic_pointer_compare_and_exchange.
+
 2005-08-04  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.h: Move the G_BEGIN_DECLS/G_END_DECLS pair outside
index ad1f163bca45de9e5c3294ce4d2ede2035442be4..eb9bec352945a1acf09f1f25e9a1c4a7c749bea3 100644 (file)
@@ -464,7 +464,7 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
   __asm__ __volatile__ ("cs %0, %2, %1"
                        : "+d" (result), "=Q" (*(atomic))
                        : "d" (newval), "m" (*(atomic)) : "cc" );
-  result == oldval;
+  return result == oldval;
 }
 #  elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
 gboolean
@@ -477,7 +477,7 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
   __asm__ __volatile__ ("csg %0, %2, %1"
                        : "+d" (result), "=Q" (*a)
                        : "d" ((long)(newval)), "m" (*a) : "cc" );
-  result == oldval;
+  return result == oldval;
 }
 #  else /* What's that */
 #    error "Your system has an unsupported pointer size"
@@ -687,5 +687,19 @@ _g_atomic_thread_init (void)
 #endif /* DEFINE_WITH_MUTEXES */
 }
 
+#ifndef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
+gint
+(g_atomic_int_get) (gint *atomic)
+{
+  return g_atomic_int_get (atomic);
+}
+
+gpointer
+(g_atomic_pointer_get) (gpointer *atomic)
+{
+  return g_atomic_pointer_get (atomic);
+}
+#endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */
+
 #define __G_ATOMIC_C__
 #include "galiasdef.c"
index 069fc1743e55963388fdd6030121aa1039ccc83a..4e050a2e7140d5e8b1964a1119dc89c4d20e5301 100644 (file)
@@ -45,10 +45,10 @@ gboolean g_atomic_pointer_compare_and_exchange (gpointer *atomic,
                                                gpointer  oldval, 
                                                gpointer  newval);
 
-#ifdef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
 gint     g_atomic_int_get                      (gint     *atomic);
 gpointer g_atomic_pointer_get                  (gpointer *atomic);
-#else /* !G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */
+
+#ifndef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
 # define g_atomic_int_get(atomic) (*(atomic))
 # define g_atomic_pointer_get(atomic) (*(atomic))
 #endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */
index 38aeaa4c5d4b8e418614d8aa93cea145d9519539..fcaa08c0e876f51ebcb950fc4569cb4d76e2bba0 100644 (file)
@@ -82,7 +82,8 @@ g_atomic_int_add
 g_atomic_int_compare_and_exchange
 g_atomic_int_exchange_and_add
 g_atomic_pointer_compare_and_exchange
-#ifdef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
+#ifdef INCLUDE_INTERNAL_SYMBOLS
+ /* these are not internal, but we don't want to alias them */
 g_atomic_int_get
 g_atomic_pointer_get
 #endif