Attempt to fix bloody MSVC atomic intrinsic mess...
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 23 Nov 2017 15:53:03 +0000 (16:53 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 23 Nov 2017 15:53:03 +0000 (16:53 +0100)
intern/atomic/intern/atomic_ops_msvc.h

index ab31b3b789a29aeef5ad01a6c3056b203de29c73..5e83675f815415ffc391c78f7fc453bacab95af4 100644 (file)
@@ -142,7 +142,7 @@ ATOMIC_INLINE int32_t atomic_sub_and_fetch_int32(int32_t *p, int32_t x)
 
 ATOMIC_INLINE int32_t atomic_cas_int32(int32_t *v, int32_t old, int32_t _new)
 {
-       return InterlockedCompareExchange(v, _new, old);
+       return InterlockedCompareExchange((long *)v, _new, old);
 }
 
 ATOMIC_INLINE int32_t atomic_fetch_and_add_int32(int32_t *p, int32_t x)
@@ -152,12 +152,12 @@ ATOMIC_INLINE int32_t atomic_fetch_and_add_int32(int32_t *p, int32_t x)
 
 ATOMIC_INLINE int32_t atomic_fetch_and_or_int32(int32_t *p, int32_t x)
 {
-       return InterlockedOr(p, x);
+       return InterlockedOr((long *)p, x);
 }
 
 ATOMIC_INLINE int32_t atomic_fetch_and_and_int32(int32_t *p, int32_t x)
 {
-       return InterlockedAnd(p, x);
+       return InterlockedAnd((long *)p, x);
 }
 
 /******************************************************************************/