From c2f850b5668cb317a494a3d7f4aac45e5c1c37c1 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 18 Oct 2018 10:44:20 +0300 Subject: [PATCH] mdbx-windows: STATIC_ASSERTs for atomic ops. Change-Id: I9797eece26db54e5f4a19f82d004ff18bdc138d6 --- src/osal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osal.h b/src/osal.h index dd923922..50416d96 100644 --- a/src/osal.h +++ b/src/osal.h @@ -679,6 +679,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 + STATIC_ASSERT(sizeof(volatile long) == sizeof(volatile uint32_t)); return _InterlockedExchangeAdd((volatile long *)p, v); #endif #ifdef __APPLE__ @@ -719,6 +720,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 + STATIC_ASSERT(sizeof(volatile long) == sizeof(volatile uint32_t)); return c == _InterlockedCompareExchange((volatile long *)p, v, c); #endif #ifdef __APPLE__