diff options
author | Yann Ylavic <ylavic@apache.org> | 2023-04-21 12:24:53 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2023-04-21 12:24:53 +0000 |
commit | 805904fe295efa5f480b067d8c60777675ea7368 (patch) | |
tree | b669398f4ac8c38c5a8355e475ffdcf8269c3123 /include/arch/unix/apr_arch_atomic.h | |
parent | 4ab133489c13382e13aea8d34aa0ec404c409f07 (diff) | |
download | apr-805904fe295efa5f480b067d8c60777675ea7368.tar.gz |
atomics: Disentangle 32bit and 64bit atomics configuration.
Allow for --enable-nonportable-atomics=upto32bit to disable 64bit atomic
builtins while still allowing for 32bit ones. yes/no still enables/disables
both (if available in the first place..).
By default (no --enable-nonportable-atomics setting), generic 64bit atomics are
forced for 32bit CPUs/systems, until we figure out how to properly align
apr_uint64_t (at least i[56]86 CPUs which could work with 64bit builtins
actually don't if the data is not 64bit aligned, assuming the same for other
32bit CPUs is safer).
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1909321 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/arch/unix/apr_arch_atomic.h')
-rw-r--r-- | include/arch/unix/apr_arch_atomic.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index ce771ad9c..a443b9dd1 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -23,37 +23,35 @@ #include "apr_atomic.h" #if defined(USE_ATOMICS_GENERIC) -/* noop */ + /* noop */ #elif HAVE_ATOMIC_BUILTINS # define USE_ATOMICS_BUILTINS -# if HAVE_ATOMIC_BUILTINS64 -# define USE_ATOMICS_BUILTINS64 -# else -# define NEED_ATOMICS_GENERIC64 -# endif #elif defined(SOLARIS2) && SOLARIS2 >= 10 # define USE_ATOMICS_SOLARIS -# define NEED_ATOMICS_GENERIC64 #elif defined(__GNUC__) && defined(__STRICT_ANSI__) /* force use of generic atomics if building e.g. with -std=c89, which * doesn't allow inline asm */ # define USE_ATOMICS_GENERIC #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) # define USE_ATOMICS_IA32 -# define NEED_ATOMICS_GENERIC64 #elif defined(__GNUC__) && (defined(__powerpc__) \ || defined(__PPC__) \ || defined(__ppc__)) # define USE_ATOMICS_PPC -# define NEED_ATOMICS_GENERIC64 #elif defined(__GNUC__) && (defined(__s390__) || defined(__s390x__)) # define USE_ATOMICS_S390 -# define NEED_ATOMICS_GENERIC64 #else # define USE_ATOMICS_GENERIC #endif -#if defined(USE_ATOMICS_GENERIC) || defined (NEED_ATOMICS_GENERIC64) +#if defined(USE_ATOMICS_GENERIC64) + /* noop */ +#elif HAVE_ATOMIC_BUILTINS64 +# define USE_ATOMICS_BUILTINS64 +#else +# define USE_ATOMICS_GENERIC64 +#endif +#if defined(USE_ATOMICS_GENERIC64) apr_status_t apr__atomic_generic64_init(apr_pool_t *p); #endif |