diff --git a/atomic/unix/builtins.c b/atomic/unix/builtins.c index 745acf1..df7574e 100644 --- a/atomic/unix/builtins.c +++ b/atomic/unix/builtins.c @@ -20,7 +20,11 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) { +#if defined (NEED_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) diff --git a/atomic/unix/builtins64.c b/atomic/unix/builtins64.c index 4a4b685..3dc5e09 100644 --- a/atomic/unix/builtins64.c +++ b/atomic/unix/builtins64.c @@ -16,7 +16,7 @@ #include "apr_arch_atomic.h" -#ifdef USE_ATOMICS_BUILTINS +#if defined(USE_ATOMICS_BUILTINS) && ! defined(NEED_ATOMICS_GENERIC64) APR_DECLARE(apr_uint64_t) apr_atomic_read64(volatile apr_uint64_t *mem) { diff --git a/include/arch/unix/apr_arch_atomic.h b/include/arch/unix/apr_arch_atomic.h index 559257d..c07d525 100644 --- a/include/arch/unix/apr_arch_atomic.h +++ b/include/arch/unix/apr_arch_atomic.h @@ -26,6 +26,9 @@ /* noop */ #elif HAVE_ATOMIC_BUILTINS # define USE_ATOMICS_BUILTINS +# if (__INTPTR_WIDTH__ == 32) && ( defined(__MIPSEL__) || defined(__powerpc__) ) || defined(__m68k__) || defined(__sh__) +# define NEED_ATOMICS_GENERIC64 +# endif #elif defined(SOLARIS2) && SOLARIS2 >= 10 # define USE_ATOMICS_SOLARIS # define NEED_ATOMICS_GENERIC64