Fix feature checks to use correct __ATOMIC flags
This commit is contained in:
parent
3f5acaa3fb
commit
569295fe30
@ -265,7 +265,7 @@ elseif (HAVE__SNPRINTF)
|
|||||||
endif ()
|
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() { 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.
|
# Create pkg-conf file.
|
||||||
# (We use the same files as ./configure does, so we
|
# (We use the same files as ./configure does, so we
|
||||||
|
@ -47,7 +47,7 @@ AC_MSG_RESULT([$have_sync_builtins])
|
|||||||
AC_MSG_CHECKING([for gcc __atomic builtins])
|
AC_MSG_CHECKING([for gcc __atomic builtins])
|
||||||
have_atomic_builtins=no
|
have_atomic_builtins=no
|
||||||
AC_TRY_LINK(
|
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],
|
[have_atomic_builtins=yes],
|
||||||
)
|
)
|
||||||
if test "x$have_atomic_builtins" = "xyes"; then
|
if test "x$have_atomic_builtins" = "xyes"; then
|
||||||
|
Loading…
Reference in New Issue
Block a user