From: Ivan Maidanski Date: Thu, 21 Apr 2016 07:59:18 +0000 (+0300) Subject: Do not force GCC atomic intrinsics usage if AO_PREFER_BUILTIN_ATOMICS X-Git-Tag: v7.6.0~214 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49b9286a8c304283ece186f1fabb27b587e7a9a6;p=libatomic_ops Do not force GCC atomic intrinsics usage if AO_PREFER_BUILTIN_ATOMICS The macro should only prevent usage of assembly completely but only if at least some of GCC atomic intrinsics are available. * src/atomic_ops/sysdeps/gcc/arm.h (AO_PREFER_BUILTIN_ATOMICS): Remove from the condition whether to include generic.h. * src/atomic_ops/sysdeps/gcc/mips.h (AO_PREFER_BUILTIN_ATOMICS): Likewise. --- diff --git a/src/atomic_ops/sysdeps/gcc/arm.h b/src/atomic_ops/sysdeps/gcc/arm.h index 0f7c958..84a96e1 100644 --- a/src/atomic_ops/sysdeps/gcc/arm.h +++ b/src/atomic_ops/sysdeps/gcc/arm.h @@ -17,9 +17,7 @@ #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) \ || __clang_major__ > 3 \ - || (__clang_major__ == 3 && __clang_minor__ >= 5) \ - || (defined(AO_PREFER_BUILTIN_ATOMICS) \ - && __GNUC__ == 4 && __GNUC_MINOR__ >= 2)) \ + || (__clang_major__ == 3 && __clang_minor__ >= 5)) \ && !defined(AO_DISABLE_GCC_ATOMICS) /* Probably, it could be enabled even for earlier gcc/clang versions. */ # define AO_GCC_ATOMIC_TEST_AND_SET diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h index 429ab07..191ad26 100644 --- a/src/atomic_ops/sysdeps/gcc/mips.h +++ b/src/atomic_ops/sysdeps/gcc/mips.h @@ -25,9 +25,7 @@ #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) \ || __clang_major__ > 3 \ - || (__clang_major__ == 3 && __clang_minor__ >= 5) \ - || (defined(AO_PREFER_BUILTIN_ATOMICS) \ - && __GNUC__ == 4 && __GNUC_MINOR__ >= 2)) \ + || (__clang_major__ == 3 && __clang_minor__ >= 5)) \ && !defined(AO_DISABLE_GCC_ATOMICS) /* Probably, it could be enabled even for earlier gcc/clang versions. */