]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fixed windows compilation issue
authorGopal Sharma <67860577+gsharma-ad@users.noreply.github.com>
Tue, 19 Dec 2023 06:14:42 +0000 (11:44 +0530)
committerTomas Mraz <tomas@openssl.org>
Fri, 22 Dec 2023 13:14:37 +0000 (14:14 +0100)
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 <tom.cosgrove@arm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23087)

include/internal/refcount.h

index 3392d3b490d526844d0d79feaa0a0ed6a0894a2a..64fb77fba58fde646ef924cb909778e32bd890b1 100644 (file)
@@ -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