summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-05-15 20:11:34 +0000
committerHavoc Pennington <hp@redhat.com>2003-05-15 20:11:34 +0000
commita1d3ffb0d417e793ca19a9087000c0dbc3641817 (patch)
treec1981566951e50e7c645b6d9c4b078e3d37abb5e
parentf0f4335bd97732d156f0b35762f61ba2d88514ab (diff)
2003-05-15 Havoc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps.c (_dbus_atomic_dec, _dbus_atomic_inc): work on non-x86. ifdef's are evil.
-rw-r--r--ChangeLog5
-rw-r--r--dbus/dbus-sysdeps.c13
2 files changed, 11 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 06981c20..2f3326d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2003-05-15 Havoc Pennington <hp@redhat.com>
+ * dbus/dbus-sysdeps.c (_dbus_atomic_dec, _dbus_atomic_inc): work
+ on non-x86. ifdef's are evil.
+
+2003-05-15 Havoc Pennington <hp@redhat.com>
+
* configure.in: 0.11
* NEWS: update
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c
index e2975c30..ab79a722 100644
--- a/dbus/dbus-sysdeps.c
+++ b/dbus/dbus-sysdeps.c
@@ -1822,11 +1822,10 @@ _dbus_atomic_inc (DBusAtomic *atomic)
#ifdef DBUS_USE_ATOMIC_INT_486
return atomic_exchange_and_add (atomic, 1);
#else
- dbus_atomic_t res;
-
+ dbus_int32_t res;
_DBUS_LOCK (atomic);
- *atomic += 1;
- res = *atomic;
+ res = atomic->value;
+ atomic->value += 1;
_DBUS_UNLOCK (atomic);
return res;
#endif
@@ -1846,11 +1845,11 @@ _dbus_atomic_dec (DBusAtomic *atomic)
#ifdef DBUS_USE_ATOMIC_INT_486
return atomic_exchange_and_add (atomic, -1);
#else
- dbus_atomic_t res;
+ dbus_int32_t res;
_DBUS_LOCK (atomic);
- *atomic -= 1;
- res = *atomic;
+ res = atomic->value;
+ atomic->value -= 1;
_DBUS_UNLOCK (atomic);
return res;
#endif