]> granicus.if.org Git - libatomic_ops/commitdiff
Use C11 double-wide atomic intrinsics for Clang/x86 on Cygwin and OS X
authorIvan Maidanski <ivmai@mail.ru>
Sat, 20 Aug 2016 14:46:48 +0000 (17:46 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 20 Aug 2016 14:46:48 +0000 (17:46 +0300)
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

index 5e54155913b8e9df52252c64c95991437d6d9559..344b78aca7d84b4e2efc934ac49e2f17661fd047 100644 (file)
@@ -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              */