mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 17:57:21 +09:00
Support gcc-like and C11-like memory fences
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user