diff options
author | J.W. Jagersma <jwjagersma@gmail.com> | 2022-11-22 19:20:53 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-25 10:29:44 +0100 |
commit | b484c6268ce38ccbc1bf5ee95bbd36f76fba994f (patch) | |
tree | f281496c9f0c08be19c47be98346a0450375a5bf /include/internal | |
parent | a2ede0396addd13f7fe9a629b450a14892152a83 (diff) |
Disable atomic refcounts with no-threads
This is needed for building with '-march=i386 no-threads', on platforms
where libatomic is not available (djgpp, specifically). The
implementation now falls back to 'CRYPTO_atomic_add()', which performs
plain lock-free addition in a 'no-threads' build.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19751)
Diffstat (limited to 'include/internal')
-rw-r--r-- | include/internal/refcount.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/internal/refcount.h b/include/internal/refcount.h index 7412d62f56..8674ab3664 100644 --- a/include/internal/refcount.h +++ b/include/internal/refcount.h @@ -13,7 +13,7 @@ # include <openssl/e_os2.h> # include <openssl/trace.h> -# ifndef OPENSSL_DEV_NO_ATOMICS +# if defined(OPENSSL_THREADS) && !defined(OPENSSL_DEV_NO_ATOMICS) # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \ && !defined(__STDC_NO_ATOMICS__) # include <stdatomic.h> |