mdbx-windows: more for WindowsXP support.

Change-Id: Ide34048720989fc010f48e086569e12e8c1edca1
This commit is contained in:
Leonid Yuriev
2018-10-06 19:28:16 +03:00
parent 83f3d820f1
commit c9e3dc373b
3 changed files with 12 additions and 3 deletions

View File

@@ -649,7 +649,7 @@ static __inline uint32_t mdbx_atomic_add32(volatile uint32_t *p, uint32_t v) {
return __sync_fetch_and_add(p, v);
#else
#ifdef _MSC_VER
return _InterlockedExchangeAdd(p, v);
return _InterlockedExchangeAdd((volatile long *)p, v);
#endif
#ifdef __APPLE__
return OSAtomicAdd32(v, (volatile int32_t *)p);
@@ -689,7 +689,7 @@ static __inline bool mdbx_atomic_compare_and_swap32(volatile uint32_t *p,
return __sync_bool_compare_and_swap(p, c, v);
#else
#ifdef _MSC_VER
return c == _InterlockedCompareExchange(p, v, c);
return c == _InterlockedCompareExchange((volatile long *)p, v, c);
#endif
#ifdef __APPLE__
return c == OSAtomicCompareAndSwap32Barrier(c, v, (volatile int32_t *)p);