diff options
author | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-06-27 21:55:09 +0000 |
---|---|---|
committer | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-06-27 21:55:09 +0000 |
commit | c1e5a44c2ed4af3d442e995449f5167e57a3f4ec (patch) | |
tree | 7760137c064cbf7af70fa2622fdd09cf1628ba6d /atomic | |
parent | 51d77a398c7cc5fd87934a82f5210d7c845538d1 (diff) | |
download | libapr-c1e5a44c2ed4af3d442e995449f5167e57a3f4ec.tar.gz |
atomic: Detect 32bit and 64bit atomic builtins separately.
Some 32bit platforms provide 32bit but not 64bit atomics, detect and
distinctly set/use HAVE_ATOMIC_BUILTINS/HAVE_ATOMIC_BUILTINS64 and
USE_ATOMICS_BUILTINS/USE_ATOMICS_BUILTINS64.
These platforms NEED_ATOMICS_GENERIC64 as 64bit implementation.
* configure.in():
Use stdint.h's uint{32,64}_t as atomic type for testing atomic builtins
when available, otherwise "unsigned int" for 32bit testing and
"unsigned long long" as 64bit.
* configure.in():
AC_TRY_RUN each 32bit and 64bit type separately, the former determining
HAVE_ATOMIC_BUILTINS and the latter HAVE_ATOMIC_BUILTINS64.
* include/arch/unix/apr_arch_atomic.h():
Define USE_ATOMICS_BUILTINS64 when HAVE_ATOMIC_BUILTINS64, otherise
define NEED_ATOMICS_GENERIC64
* include/arch/unix/apr_arch_atomic.h():
Check defined(__powerpc__) for USE_ATOMICS_PPC.
* atomic/unix/builtins64.c():
Implement for USE_ATOMICS_BUILTINS64 only.
BZ 63566.
Merge r1902266 from trunk.
Submitted by: ylavic
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1902290 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'atomic')
-rw-r--r-- | atomic/unix/builtins64.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/atomic/unix/builtins64.c b/atomic/unix/builtins64.c index 0f6edffbb..7d8422548 100644 --- a/atomic/unix/builtins64.c +++ b/atomic/unix/builtins64.c @@ -16,7 +16,7 @@ #include "apr_arch_atomic.h" -#ifdef USE_ATOMICS_BUILTINS +#ifdef USE_ATOMICS_BUILTINS64 #if defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__) #define WEAK_MEMORY_ORDERING 1 @@ -106,4 +106,4 @@ APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint #endif } -#endif /* USE_ATOMICS_BUILTINS */ +#endif /* USE_ATOMICS_BUILTINS64 */ |