Fix detection of the GCC __sync intrinsics.
authorThiago Macieira <thiago@kde.org>
Thu, 16 Jul 2009 13:17:25 +0000 (15:17 +0200)
committerThiago Macieira <thiago@kde.org>
Thu, 16 Jul 2009 14:00:57 +0000 (16:00 +0200)
We have to use the return value, otherwise GCC optimises the code
by using instructions that don't return anything. That won't
match what we actually use in dbus-sysdeps-unix.c

configure.in

index 036679c..2a0e64e 100644 (file)
@@ -595,7 +595,7 @@ fi
 AC_CACHE_CHECK([whether $CC knows __sync_sub_and_fetch()],
   dbus_cv_sync_sub_and_fetch,
   [AC_LINK_IFELSE(
-     AC_LANG_PROGRAM([], [[int a = 4; __sync_sub_and_fetch(&a, 4);]]),
+     AC_LANG_PROGRAM([], [[int a = 4; int b = __sync_sub_and_fetch(&a, 4);]]),
      [dbus_cv_sync_sub_and_fetch=yes],
      [dbus_cv_sync_sub_and_fetch=no])
   ])