From: Willy Tarreau Date: Mon, 7 Apr 2025 07:36:16 +0000 (+0200) Subject: BUILD: atomics: fix build issue on non-x86/non-arm systems X-Git-Tag: v3.2-dev10~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f01ff2478f674671df75e011f428e0abf794d3dc;p=thirdparty%2Fhaproxy.git BUILD: atomics: fix build issue on non-x86/non-arm systems Commit f435a2e518 ("CLEANUP: atomics: also replace __sync_synchronize() with __atomic_thread_fence()") replaced the builtins used for barriers, but the different API required an argument while the macros didn't specify any, resulting in double parenthesis that were causing obscure build errors such as "called object type 'void' is not a function or function pointer". Let's just specify the args for the macro. No backport is needed. --- diff --git a/include/haproxy/atomic.h b/include/haproxy/atomic.h index 36e024603..5116c2d15 100644 --- a/include/haproxy/atomic.h +++ b/include/haproxy/atomic.h @@ -685,12 +685,12 @@ static __inline int __ha_cas_dw(void *target, void *compare, void *set) #else /* unknown / unhandled architecture, fall back to generic barriers */ -#define __ha_barrier_atomic_load __atomic_thread_fence(__ATOMIC_ACQUIRE) -#define __ha_barrier_atomic_store __atomic_thread_fence(__ATOMIC_RELEASE) -#define __ha_barrier_atomic_full __atomic_thread_fence(__ATOMIC_SEQ_CST) -#define __ha_barrier_load __atomic_thread_fence(__ATOMIC_ACQUIRE) -#define __ha_barrier_store __atomic_thread_fence(__ATOMIC_RELEASE) -#define __ha_barrier_full __atomic_thread_fence(__ATOMIC_SEQ_CST) +#define __ha_barrier_atomic_load() __atomic_thread_fence(__ATOMIC_ACQUIRE) +#define __ha_barrier_atomic_store() __atomic_thread_fence(__ATOMIC_RELEASE) +#define __ha_barrier_atomic_full() __atomic_thread_fence(__ATOMIC_SEQ_CST) +#define __ha_barrier_load() __atomic_thread_fence(__ATOMIC_ACQUIRE) +#define __ha_barrier_store() __atomic_thread_fence(__ATOMIC_RELEASE) +#define __ha_barrier_full() __atomic_thread_fence(__ATOMIC_SEQ_CST) /* Note: there is no generic DWCAS */