Skip to content

Commit

Permalink
Avoid C11 Atomics on Windows (#1824)
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Sep 4, 2024
1 parent 8e07897 commit f88ef5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdatomic.h>
// CRYPTO_refcount_t is a |uint32_t|
#define AWS_LC_ATOMIC_LOCK_FREE ATOMIC_LONG_LOCK_FREE
Expand All @@ -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

Expand Down

0 comments on commit f88ef5d

Please sign in to comment.