From: Ivan Maidanski Date: Tue, 5 Dec 2017 21:28:33 +0000 (+0300) Subject: Do not expose AO_GCC_FORCE_HAVE_CAS macro to client code X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=058faf6168b980274c1a1681c6666fe61263170c;p=libatomic_ops Do not expose AO_GCC_FORCE_HAVE_CAS macro to client code (code refactoring) * src/atomic_ops/sysdeps/gcc/aarch64.h (AO_GCC_FORCE_HAVE_CAS, AO_GCC_HAVE_double_SYNC_CAS): Undefine at the end of file. * src/atomic_ops/sysdeps/gcc/hexagon.h (AO_GCC_FORCE_HAVE_CAS, AO_GCC_HAVE_double_SYNC_CAS): Likewise. * src/atomic_ops/sysdeps/gcc/mips.h (AO_GCC_FORCE_HAVE_CAS): Likewise. * src/atomic_ops/sysdeps/gcc/x86.h (AO_GCC_FORCE_HAVE_CAS): Likewise. --- diff --git a/src/atomic_ops/sysdeps/gcc/aarch64.h b/src/atomic_ops/sysdeps/gcc/aarch64.h index 6bc8bef..010fcdd 100644 --- a/src/atomic_ops/sysdeps/gcc/aarch64.h +++ b/src/atomic_ops/sysdeps/gcc/aarch64.h @@ -219,5 +219,7 @@ #include "generic.h" +#undef AO_GCC_FORCE_HAVE_CAS +#undef AO_GCC_HAVE_double_SYNC_CAS #undef AO_SKIPATOMIC_double_load #undef AO_SKIPATOMIC_double_load_acquire diff --git a/src/atomic_ops/sysdeps/gcc/hexagon.h b/src/atomic_ops/sysdeps/gcc/hexagon.h index 19b348b..ca0d897 100644 --- a/src/atomic_ops/sysdeps/gcc/hexagon.h +++ b/src/atomic_ops/sysdeps/gcc/hexagon.h @@ -135,3 +135,6 @@ AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val) #define AO_T_IS_INT #endif /* AO_DISABLE_GCC_ATOMICS */ + +#undef AO_GCC_FORCE_HAVE_CAS +#undef AO_GCC_HAVE_double_SYNC_CAS diff --git a/src/atomic_ops/sysdeps/gcc/mips.h b/src/atomic_ops/sysdeps/gcc/mips.h index 9024542..d7a3620 100644 --- a/src/atomic_ops/sysdeps/gcc/mips.h +++ b/src/atomic_ops/sysdeps/gcc/mips.h @@ -189,6 +189,7 @@ AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) /* generated automatically (and AO_int_... primitives are */ /* defined properly after the first generalization pass). */ +#undef AO_GCC_FORCE_HAVE_CAS #undef AO_MIPS_LL #undef AO_MIPS_LL_1 #undef AO_MIPS_SC diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index 28b0f17..f1e927f 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -571,6 +571,7 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val, # include "generic.h" #endif +#undef AO_GCC_FORCE_HAVE_CAS #undef AO_SKIPATOMIC_double_compare_and_swap_ANY #undef AO_SKIPATOMIC_double_load #undef AO_SKIPATOMIC_double_load_acquire