]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
cmake: Fix definition of DBUS_USE_SYNC
authorAlex Richardson <arichardson.kde@gmail.com>
Sun, 15 May 2022 10:28:51 +0000 (11:28 +0100)
committerSimon McVittie <smcv@collabora.com>
Mon, 16 May 2022 18:39:26 +0000 (18:39 +0000)
dbus-sysdeps-unix.c checks for DBUS_USE_SYNC using 0/1 checks not defined
checks, so we should be using #cmakedefine01. This fixes lots of -Wundef
warnings when compiling for FreeBSD and ensures that we actually use
atomics instead of the pthread fallback there.

cmake/ConfigureChecks.cmake
cmake/config.h.cmake

index ce8f4f9d656592d63b80064aaa9897aaf94f05ec..f24503338cb7595189da7232c158d30c4cfb1da3 100644 (file)
@@ -141,7 +141,7 @@ CHECK_C_SOURCE_COMPILES("
 int main() {
     int a = 4;
     int b = __sync_sub_and_fetch(&a, 4);
-    exit(b);
+    return b;
 }
 " DBUS_USE_SYNC)
 
index 74299d1ea5406ab9eb962f3da93adc9b0c270d20..358f9d8229d0e237a448375e93071675f202bcd9 100644 (file)
 #cmakedefine DBUS_HAVE_LINUX_EPOLL 1
 
 /* Use the gcc __sync extension */
-#cmakedefine DBUS_USE_SYNC 1
+#cmakedefine01 DBUS_USE_SYNC
 #cmakedefine HAVE_VASPRINTF 1
 #cmakedefine HAVE_VSNPRINTF 1