From 50a811ca076f9466f337b21e160fc79b06b07c4a Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Wed, 12 Feb 2014 08:44:29 +0200 Subject: [PATCH] Fix feature checks to use correct __ATOMIC flags --- CMakeLists.txt | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e6b9e0..24fe2b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,7 +265,7 @@ elseif (HAVE__SNPRINTF) endif () check_c_source_compiles ("int main() { unsigned long val; __sync_bool_compare_and_swap(&val, 0, 1); return 0; } " HAVE_SYNC_BUILTINS) -check_c_source_compiles ("int main() { char l; unsigned long v; __atomic_test_and_set(&l, __ATOMIC_RELAXED); __atomic_store_n(&v, 1, __ATOMIC_ACQ_REL); __atomic_load_n(&v, __ATOMIC_ACQUIRE); return 0; }" HAVE_ATOMIC_BUILTINS) +check_c_source_compiles ("int main() { char l; unsigned long v; __atomic_test_and_set(&l, __ATOMIC_RELAXED); __atomic_store_n(&v, 1, __ATOMIC_RELEASE); __atomic_load_n(&v, __ATOMIC_ACQUIRE); return 0; }" HAVE_ATOMIC_BUILTINS) # Create pkg-conf file. # (We use the same files as ./configure does, so we diff --git a/configure.ac b/configure.ac index e871f5f..68d6fd6 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ AC_MSG_RESULT([$have_sync_builtins]) AC_MSG_CHECKING([for gcc __atomic builtins]) have_atomic_builtins=no AC_TRY_LINK( - [], [char l; unsigned long v; __atomic_test_and_set(&l, __ATOMIC_RELAXED); __atomic_store_n(&v, 1, __ATOMIC_ACQ_REL); __atomic_load_n(&v, __ATOMIC_ACQUIRE);], + [], [char l; unsigned long v; __atomic_test_and_set(&l, __ATOMIC_RELAXED); __atomic_store_n(&v, 1, __ATOMIC_RELEASE); __atomic_load_n(&v, __ATOMIC_ACQUIRE);], [have_atomic_builtins=yes], ) if test "x$have_atomic_builtins" = "xyes"; then