aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 01d7d940b..6c702e76d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -923,15 +923,22 @@ CHECK_C_SOURCE_COMPILES ("#include <sys/types.h>
ENDIF(NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
CHECK_C_SOURCE_RUNS("
+#include <stdbool.h>
int main(int argc, char **argv) {
- int a = 0;
- if (__sync_bool_compare_and_swap(&a, 0, 1)) {
+ int a = 0, b = 0;
+ if (__atomic_compare_exchange_n(&a, &b, 1, false, __ATOMIC_RELEASE, __ATOMIC_RELAXED)) {
return 0;
}
return -1;
}
" HAVE_ATOMIC_BUILTINS)
+IF(NOT HAVE_ATOMIC_BUILTINS)
+ MESSAGE(STATUS "atomic builtins are -NOT- supported")
+ELSE()
+ MESSAGE(STATUS "atomic builtins are supported")
+ENDIF()
+
# Check queue.h compatibility
IF(NOT HAVE_COMPATIBLE_QUEUE_H)
INCLUDE_DIRECTORIES(compat)