summaryrefslogtreecommitdiffstats
path: root/atomic/unix/builtins.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 04:59:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 04:59:58 +0000
commitb8d375bcb1f462d5af5d1f480b32d7b0038417f6 (patch)
tree93d48ade79cc9d5892f17ff41c33753be6bb0879 /atomic/unix/builtins.c
parentAdding upstream version 1.7.2. (diff)
downloadapr-b8d375bcb1f462d5af5d1f480b32d7b0038417f6.tar.xz
apr-b8d375bcb1f462d5af5d1f480b32d7b0038417f6.zip
Adding upstream version 1.7.5.upstream/1.7.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'atomic/unix/builtins.c')
-rw-r--r--atomic/unix/builtins.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/atomic/unix/builtins.c b/atomic/unix/builtins.c
index 22b828c..5165e72 100644
--- a/atomic/unix/builtins.c
+++ b/atomic/unix/builtins.c
@@ -18,15 +18,20 @@
#ifdef USE_ATOMICS_BUILTINS
-#if defined(__arm__) || defined(__powerpc__) || defined(__powerpc64__)
-#define WEAK_MEMORY_ORDERING 1
-#else
+#if defined(__i386__) || defined(__x86_64__) \
+ || defined(__s390__) || defined(__s390x__)
#define WEAK_MEMORY_ORDERING 0
+#else
+#define WEAK_MEMORY_ORDERING 1
#endif
APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p)
{
+#if defined (USE_ATOMICS_GENERIC64)
+ return apr__atomic_generic64_init(p);
+#else
return APR_SUCCESS;
+#endif
}
APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t *mem)
@@ -114,7 +119,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint
APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *ptr, const void *cmp)
{
#if HAVE__ATOMIC_BUILTINS
- __atomic_compare_exchange_n(mem, (void **)&cmp, ptr, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
+ __atomic_compare_exchange_n(mem, (void *)&cmp, ptr, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
return (void *)cmp;
#else
return (void *)__sync_val_compare_and_swap(mem, (void *)cmp, ptr);