diff --git a/crypto/internal.h b/crypto/internal.h index 62ce4a3271..8e6aee9f44 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -580,7 +580,8 @@ OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)); // Reference counting. -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#if !defined(__STDC_NO_ATOMICS__) && defined(__STDC_VERSION__) && \ + __STDC_VERSION__ >= 201112L #include // CRYPTO_refcount_t is a |uint32_t| #define AWS_LC_ATOMIC_LOCK_FREE ATOMIC_LONG_LOCK_FREE @@ -589,9 +590,8 @@ OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)); #endif // Automatically enable C11 atomics if implemented and lock free -#if !defined(OPENSSL_C11_ATOMIC) && defined(OPENSSL_THREADS) && \ - !defined(__STDC_NO_ATOMICS__) && defined(__STDC_VERSION__) && \ - __STDC_VERSION__ >= 201112L && AWS_LC_ATOMIC_LOCK_FREE == 2 +#if !defined(OPENSSL_C11_ATOMIC) && defined(OPENSSL_THREADS) && \ + AWS_LC_ATOMIC_LOCK_FREE == 2 #define OPENSSL_C11_ATOMIC #endif