Support gcc-like and C11-like memory fences

This commit is contained in:
Frank Denis
2023-09-09 09:01:51 +02:00
parent e95d437f84
commit 5e4affe9d8
@@ -258,8 +258,10 @@ extern void ct_unpoison(const void *, size_t);
# define UNPOISON(X, L) (void) 0 # define UNPOISON(X, L) (void) 0
#endif #endif
#ifdef __ATOMIC_ACQUIRE #ifdef HAVE_GCC_MEMORY_FENCES
# define ACQUIRE_FENCE __atomic_thread_fence(__ATOMIC_ACQUIRE) # define ACQUIRE_FENCE __atomic_thread_fence(__ATOMIC_ACQUIRE)
#elif defined(HAVE_C11_MEMORY_FENCES)
# define ACQUIRE_FENCE atomic_thread_fence(memory_order_acquire)
#else #else
# define ACQUIRE_FENCE (void) 0 # define ACQUIRE_FENCE (void) 0
#endif #endif