From d14ca5cc4ffa3e7bfa66fc2d3442471cf353d976 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 7 Jan 2018 02:56:06 +0300 Subject: [PATCH] mdbx: fix _InterlockedExchangeAdd64 for some 32-bit SDKs. Change-Id: I18280e8ef6432b9db3c5073fd59eaa102462f98d --- src/osal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osal.h b/src/osal.h index 871e52b0..7951434a 100644 --- a/src/osal.h +++ b/src/osal.h @@ -569,8 +569,12 @@ static __inline uint64_t mdbx_atomic_add64(volatile uint64_t *p, uint64_t v) { return __sync_fetch_and_add(p, v); #else #ifdef _MSC_VER +#ifdef _WIN64 return _InterlockedExchangeAdd64((volatile int64_t *)p, v); +#else + return InterlockedExchangeAdd64((volatile int64_t *)p, v); #endif +#endif /* _MSC_VER */ #ifdef __APPLE__ return OSAtomicAdd64(v, (volatile int64_t *)p); #endif