From: J.W. Jagersma Date: Tue, 22 Nov 2022 18:20:53 +0000 (+0100) Subject: Disable atomic refcounts with no-threads X-Git-Tag: openssl-3.2.0-alpha1~1664 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b484c6268ce38ccbc1bf5ee95bbd36f76fba994f;p=thirdparty%2Fopenssl.git 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 Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19751) --- diff --git a/include/internal/refcount.h b/include/internal/refcount.h index 7412d62f56f..8674ab3664e 100644 --- a/include/internal/refcount.h +++ b/include/internal/refcount.h @@ -13,7 +13,7 @@ # include # include -# 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