summaryrefslogtreecommitdiff
path: root/atomic
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-06-26 22:50:09 +0000
committerYann Ylavic <ylavic@apache.org>2022-06-26 22:50:09 +0000
commit849781e74f9b6c2d6403ca834227167735480020 (patch)
treee211df96d33a97656047c2571c2baf97942d6e06 /atomic
parentff9883c921fcb1bbf21e19f7a739e00b0c74da68 (diff)
downloadapr-849781e74f9b6c2d6403ca834227167735480020.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. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902266 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'atomic')
-rw-r--r--atomic/unix/builtins64.c4
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 */