dbus/dbus dbus-sysdeps-unix.c,1.17,1.18 dbus-sysdeps.c,1.119,1.120

Ralf Habacker rhabacker at kemper.freedesktop.org
Mon Jan 1 13:30:01 PST 2007


Update of /cvs/dbus/dbus/dbus
In directory kemper:/tmp/cvs-serv32449/dbus

Modified Files:
	dbus-sysdeps-unix.c dbus-sysdeps.c 
Log Message:
* dbus/dbus-sysdeps-unix.c: unix compile fix, moved 
atomic_exchange_and_add() from dbus/dbus-sysdeps.c 
to here, it's used by _dbus_atomic_inc() and _dbus_atomic_dec().

Index: dbus-sysdeps-unix.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps-unix.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- dbus-sysdeps-unix.c	31 Dec 2006 12:16:04 -0000	1.17
+++ dbus-sysdeps-unix.c	1 Jan 2007 21:29:59 -0000	1.18
@@ -1428,6 +1428,24 @@
   return getuid ();
 }
 
+_DBUS_DEFINE_GLOBAL_LOCK (atomic);
+
+#ifdef DBUS_USE_ATOMIC_INT_486
+/* Taken from CVS version 1.7 of glibc's sysdeps/i386/i486/atomicity.h */
+/* Since the asm stuff here is gcc-specific we go ahead and use "inline" also */
+static inline dbus_int32_t
+atomic_exchange_and_add (DBusAtomic            *atomic,
+                         volatile dbus_int32_t  val)
+{
+  register dbus_int32_t result;
+
+  __asm__ __volatile__ ("lock; xaddl %0,%1"
+                        : "=r" (result), "=m" (atomic->value)
+			: "0" (val), "m" (atomic->value));
+  return result;
+}
+#endif
+
 /**
  * Atomically increments an integer
  *

Index: dbus-sysdeps.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- dbus-sysdeps.c	31 Dec 2006 12:16:04 -0000	1.119
+++ dbus-sysdeps.c	1 Jan 2007 21:29:59 -0000	1.120
@@ -644,24 +644,6 @@
     return FALSE;
 }
 
-_DBUS_DEFINE_GLOBAL_LOCK (atomic);
-
-#ifdef DBUS_USE_ATOMIC_INT_486
-/* Taken from CVS version 1.7 of glibc's sysdeps/i386/i486/atomicity.h */
-/* Since the asm stuff here is gcc-specific we go ahead and use "inline" also */
-static inline dbus_int32_t
-atomic_exchange_and_add (DBusAtomic            *atomic,
-                         volatile dbus_int32_t  val)
-{
-  register dbus_int32_t result;
-
-  __asm__ __volatile__ ("lock; xaddl %0,%1"
-                        : "=r" (result), "=m" (atomic->value)
-			: "0" (val), "m" (atomic->value));
-  return result;
-}
-#endif
-
 void
 _dbus_generate_pseudorandom_bytes_buffer (char *buffer,
                                           int   n_bytes)



More information about the dbus-commit mailing list