]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Add cmake check for DBUS_USE_SYNC
authorRalf Habacker <ralf.habacker@freenet.de>
Sun, 21 Oct 2018 09:34:13 +0000 (11:34 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 24 Oct 2018 08:03:30 +0000 (10:03 +0200)
Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18

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

index b31d5b6bd996087d1e8628e200dedf76cce62cfa..39c2ed5b35415efbdeb64e8d2a6a5e0655696da2 100644 (file)
@@ -142,6 +142,14 @@ if (NOT VA_COPY_AS_ARRAY)
     set(DBUS_VA_COPY_AS_ARRAY 1 CACHE STRING "'va_lists' cannot be copies as values")
 endif()
 
+CHECK_C_SOURCE_COMPILES("
+int main() {
+    int a = 4;
+    int b = __sync_sub_and_fetch(&a, 4);
+    exit(b);
+}
+" DBUS_USE_SYNC)
+
 # missing:
 # DBUS_HAVE_GCC33_GCOV
 
index dc5d990b1f7e473b81382bdbed0b382651aced71..1235a4504a2ff6691c338af5eead76c370377709 100644 (file)
 /* Define to use epoll(4) on Linux */
 #cmakedefine DBUS_HAVE_LINUX_EPOLL 1
 
+/* Use the gcc __sync extension */
+#cmakedefine DBUS_USE_SYNC 1
+
 // structs
 /* Define to 1 if you have struct cmsgred */
 #cmakedefine    HAVE_CMSGCRED 1