Merge pull request #7989 from billphipps/atomic_fence

Update to use memory_order_seq_cst instead of GCC internal for C11
pull/8000/head
András Fekete 2024-09-20 09:46:27 -04:00 committed by GitHub
commit 005a57f745
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1257,7 +1257,7 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
/* use user-supplied XFENCE definition. */ /* use user-supplied XFENCE definition. */
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
#include <stdatomic.h> #include <stdatomic.h>
#define XFENCE() atomic_thread_fence(__ATOMIC_SEQ_CST) #define XFENCE() atomic_thread_fence(memory_order_seq_cst)
#elif defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC__ < 5) #elif defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC__ < 5)
#define XFENCE() __sync_synchronize() #define XFENCE() __sync_synchronize()
#elif (defined(__GNUC__) && (__GNUC__ >= 5)) || defined (__clang__) #elif (defined(__GNUC__) && (__GNUC__ >= 5)) || defined (__clang__)