From: Gopal Sharma <67860577+gsharma-ad@users.noreply.github.com> Date: Tue, 19 Dec 2023 06:14:42 +0000 (+0530) Subject: Fixed windows compilation issue X-Git-Tag: openssl-3.0.13~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa50768bf6d0a987028175c4a3cac8a142b15941;p=thirdparty%2Fopenssl.git Fixed windows compilation issue Fixed - Windows compilation issue - unbale to find correct definitions of _InterlockedExchangeAdd. Issue number - https://github.com/openssl/openssl/issues/21080 CLA: trivial Reviewed-by: Tom Cosgrove Reviewed-by: Matt Caswell Reviewed-by: Hugo Landau Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/23087) --- diff --git a/include/internal/refcount.h b/include/internal/refcount.h index 3392d3b490d..64fb77fba58 100644 --- a/include/internal/refcount.h +++ b/include/internal/refcount.h @@ -134,14 +134,14 @@ static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, ossl_unused void *lock) { - *ret = _InterlockedExchangeAdd(val, 1) + 1; + *ret = _InterlockedExchangeAdd((long volatile *)val, 1) + 1; return 1; } static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, ossl_unused void *lock) { - *ret = _InterlockedExchangeAdd(val, -1) - 1; + *ret = _InterlockedExchangeAdd((long volatile *)val, -1) - 1; return 1; } # endif