From f6a1b686f03aa801ebed7a1799e62849a31b1d37 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 20 Aug 2016 17:46:48 +0300 Subject: [PATCH] Use C11 double-wide atomic intrinsics for Clang/x86 on Cygwin and OS X Others (e.g., NDK clang/i686) still might need -latomic linker option. * src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET && __clang__]: Do not fallback to non-intrinsic implementation if __APPLE_CC__ or __CYGWIN__. --- src/atomic_ops/sysdeps/gcc/x86.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index 5e54155..344b78a 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -292,7 +292,8 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val, #endif /* AO_DISABLE_GCC_ATOMICS */ #if (defined(AO_PREFER_BUILTIN_ATOMICS) || !defined(__clang__) \ - || defined(__x86_64__)) && defined(AO_GCC_ATOMIC_TEST_AND_SET) + || defined(__x86_64__) || defined(__APPLE_CC__) || defined(__CYGWIN__)) \ + && defined(AO_GCC_ATOMIC_TEST_AND_SET) /* As of clang-3.8 i686 (NDK r11c), it requires -latomic for all the */ /* double-wide operations. For now, we fall back to the */ -- 2.40.0