diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index b31d5b6b..39c2ed5b 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -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 diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index dc5d990b..1235a450 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -216,6 +216,9 @@ /* 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