diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-12-06 00:43:43 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-12-11 00:42:54 +0300 |
commit | 0a724b10166324fa9bda8eec668b2c898fb27387 (patch) | |
tree | 9a030ff0b86d2519c31a1157419c94ad27c4368b /src | |
parent | ed591401b5827f70b81d73186b49286321075aba (diff) | |
download | libatomic_ops-0a724b10166324fa9bda8eec668b2c898fb27387.tar.gz |
Use standalone private macro to guard against AO_GCC_BARRIER redefinition
(code refactoring)
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h:
Regenerate.
* src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_GCC_BARRIER): Define only if AO_HAVE_GCC_BARRIER is undefined.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
[!AO_HAVE_GCC_BARRIER] (AO_HAVE_GCC_BARRIER): Define macro.
Diffstat (limited to 'src')
5 files changed, 10 insertions, 5 deletions
diff --git a/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h b/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h index 3c7341e..adbaa9a 100644 --- a/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h @@ -31,13 +31,14 @@ /* subexpressions across a volatile load; hence, we now add compiler */ /* barriers for gcc. */ -#ifndef AO_GCC_BARRIER +#ifndef AO_HAVE_GCC_BARRIER /* TODO: Check GCC version (if workaround not needed for modern GCC). */ # if defined(__GNUC__) # define AO_GCC_BARRIER() AO_compiler_barrier() # else # define AO_GCC_BARRIER() (void)0 # endif +# define AO_HAVE_GCC_BARRIER #endif AO_INLINE AO_t diff --git a/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template b/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template index a7dfd15..95846d6 100644 --- a/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template +++ b/src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template @@ -31,13 +31,14 @@ /* subexpressions across a volatile load; hence, we now add compiler */ /* barriers for gcc. */ -#ifndef AO_GCC_BARRIER +#ifndef AO_HAVE_GCC_BARRIER /* TODO: Check GCC version (if workaround not needed for modern GCC). */ # if defined(__GNUC__) # define AO_GCC_BARRIER() AO_compiler_barrier() # else # define AO_GCC_BARRIER() (void)0 # endif +# define AO_HAVE_GCC_BARRIER #endif AO_INLINE XCTYPE diff --git a/src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h b/src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h index 1a23058..25438fd 100644 --- a/src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h @@ -31,13 +31,14 @@ /* subexpressions across a volatile load; hence, we now add compiler */ /* barriers for gcc. */ -#ifndef AO_GCC_BARRIER +#ifndef AO_HAVE_GCC_BARRIER /* TODO: Check GCC version (if workaround not needed for modern GCC). */ # if defined(__GNUC__) # define AO_GCC_BARRIER() AO_compiler_barrier() # else # define AO_GCC_BARRIER() (void)0 # endif +# define AO_HAVE_GCC_BARRIER #endif AO_INLINE unsigned/**/char diff --git a/src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h b/src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h index 18a7e4b..7ab17d9 100644 --- a/src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h @@ -31,13 +31,14 @@ /* subexpressions across a volatile load; hence, we now add compiler */ /* barriers for gcc. */ -#ifndef AO_GCC_BARRIER +#ifndef AO_HAVE_GCC_BARRIER /* TODO: Check GCC version (if workaround not needed for modern GCC). */ # if defined(__GNUC__) # define AO_GCC_BARRIER() AO_compiler_barrier() # else # define AO_GCC_BARRIER() (void)0 # endif +# define AO_HAVE_GCC_BARRIER #endif AO_INLINE unsigned diff --git a/src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h b/src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h index 19f7781..36bb2e4 100644 --- a/src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h +++ b/src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h @@ -31,13 +31,14 @@ /* subexpressions across a volatile load; hence, we now add compiler */ /* barriers for gcc. */ -#ifndef AO_GCC_BARRIER +#ifndef AO_HAVE_GCC_BARRIER /* TODO: Check GCC version (if workaround not needed for modern GCC). */ # if defined(__GNUC__) # define AO_GCC_BARRIER() AO_compiler_barrier() # else # define AO_GCC_BARRIER() (void)0 # endif +# define AO_HAVE_GCC_BARRIER #endif AO_INLINE unsigned/**/short |