Skip to content

Commit

Permalink
Fixed windows compilation issue
Browse files Browse the repository at this point in the history
Fixed - Windows compilation issue - unbale to find correct definitions of _InterlockedExchangeAdd.
Issue number - #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 #23087)

(cherry picked from commit aa50768)
  • Loading branch information
gsharma-ad authored and t8m committed Dec 22, 2023
1 parent a26635e commit f685ca3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/internal/refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f685ca3

Please sign in to comment.