Add cmake check for DBUS_USE_SYNC

Reviewed-by: Simon McVittie <smcv@collabora.com>
Bug: https://gitlab.freedesktop.org/dbus/dbus/merge_requests/18
This commit is contained in:
Ralf Habacker 2018-10-21 11:34:13 +02:00
parent bd6ece893a
commit 6c95c7e395
2 changed files with 11 additions and 0 deletions

View 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

View file

@ -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