From f685ca3173956d201aa63e1522dc68a78098c12a Mon Sep 17 00:00:00 2001 From: Gopal Sharma <67860577+gsharma-ad@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:44:42 +0530 Subject: 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) (cherry picked from commit aa50768bf6d0a987028175c4a3cac8a142b15941) --- include/internal/refcount.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/internal/refcount.h b/include/internal/refcount.h index 3392d3b490..64fb77fba5 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 -- cgit v1.2.3