Support gcc-like and C11-like memory fences

This commit is contained in:
Frank Denis 2022-03-07 16:47:43 +01:00
parent e95d437f84
commit 5e4affe9d8

View File

@ -258,8 +258,10 @@ extern void ct_unpoison(const void *, size_t);
# define UNPOISON(X, L) (void) 0
#endif
#ifdef __ATOMIC_ACQUIRE
#ifdef HAVE_GCC_MEMORY_FENCES
# define ACQUIRE_FENCE __atomic_thread_fence(__ATOMIC_ACQUIRE)
#elif defined(HAVE_C11_MEMORY_FENCES)
# define ACQUIRE_FENCE atomic_thread_fence(memory_order_acquire)
#else
# define ACQUIRE_FENCE (void) 0
#endif