summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2007-01-01 21:29:59 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2007-01-01 21:29:59 +0000
commitd45c4a1f40c80d203b6ca8efc338a61d9232846e (patch)
treeb28750f47ad06ad097cec22cd86f3c15872fc836
parent3a33c8e294bf1b4338fc81bcd9b0889de3c0e0f0 (diff)
* 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().
-rw-r--r--ChangeLog6
-rw-r--r--dbus/dbus-sysdeps-unix.c18
-rw-r--r--dbus/dbus-sysdeps.c18
3 files changed, 24 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f93608e..f0c154e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-12-31 Ralf Habacker <ralf.habacker@freenet.de>
+ * 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().
+
+2006-12-31 Ralf Habacker <ralf.habacker@freenet.de>
+
* tools/dbus-monitor.c: gettimeofday() is not available
on windows so we have to provide our own. It's taken from
lgpl'd kdewin32 package. - Patches from Christian Ehrlicher
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index 9b6457b2..26fa5f94 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -1428,6 +1428,24 @@ _dbus_getuid (void)
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
*
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c
index 5bd202af..8a437cad 100644
--- a/dbus/dbus-sysdeps.c
+++ b/dbus/dbus-sysdeps.c
@@ -644,24 +644,6 @@ _dbus_credentials_match (const DBusCredentials *expected_credentials,
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)