From: Bernd Edlinger Date: Wed, 19 Feb 2025 13:40:44 +0000 (+0100) Subject: Make CRYPTO_atomic_load/store use the same preprocessor guards X-Git-Tag: openssl-3.3.4~162 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0357ef75f360f0249a3d0be6f1c3f5f5bd430f2;p=thirdparty%2Fopenssl.git Make CRYPTO_atomic_load/store use the same preprocessor guards as the other CRYPTO_atomic_X functions. All CRYPTO_atomic functions should use the same logic here, just in case... Reviewed-by: Tomas Mraz Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/26815) (cherry picked from commit 3240427a8530f5aa6070f135e954e20e591fa132) --- diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c index c61ed00d194..65d8439cbc0 100644 --- a/crypto/threads_pthread.c +++ b/crypto/threads_pthread.c @@ -780,7 +780,7 @@ int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret, int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock) { -# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS) +# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS) if (__atomic_is_lock_free(sizeof(*val), val)) { __atomic_load(val, ret, __ATOMIC_ACQUIRE); return 1; @@ -803,7 +803,7 @@ int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock) int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock) { -# if defined(__GNUC__) && defined(__ATOMIC_ACQUIRE) && !defined(BROKEN_CLANG_ATOMICS) +# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL) && !defined(BROKEN_CLANG_ATOMICS) if (__atomic_is_lock_free(sizeof(*val), val)) { __atomic_load(val, ret, __ATOMIC_ACQUIRE); return 1;