[Bf-blender-cvs] [e704d8a6163] master: Moar attempt to fix bloody MSVC intrinsic mess...

Bastien Montagne noreply at git.blender.org
Thu Nov 23 16:58:43 CET 2017


Commit: e704d8a616376d3e0a0796396133dfe5c4df6cd5
Author: Bastien Montagne
Date:   Thu Nov 23 16:58:20 2017 +0100
Branches: master
https://developer.blender.org/rBe704d8a616376d3e0a0796396133dfe5c4df6cd5

Moar attempt to fix bloody MSVC intrinsic mess...

===================================================================

M	intern/atomic/intern/atomic_ops_msvc.h

===================================================================

diff --git a/intern/atomic/intern/atomic_ops_msvc.h b/intern/atomic/intern/atomic_ops_msvc.h
index 5e83675f815..c24a9095735 100644
--- a/intern/atomic/intern/atomic_ops_msvc.h
+++ b/intern/atomic/intern/atomic_ops_msvc.h
@@ -132,12 +132,12 @@ ATOMIC_INLINE uint32_t atomic_fetch_and_and_uint32(uint32_t *p, uint32_t x)
 /* Signed */
 ATOMIC_INLINE int32_t atomic_add_and_fetch_int32(int32_t *p, int32_t x)
 {
-	return InterlockedExchangeAdd(p, x) + x;
+	return InterlockedExchangeAdd((long *)p, x) + x;
 }
 
 ATOMIC_INLINE int32_t atomic_sub_and_fetch_int32(int32_t *p, int32_t x)
 {
-	return InterlockedExchangeAdd(p, -x) - x;
+	return InterlockedExchangeAdd((long *)p, -x) - x;
 }
 
 ATOMIC_INLINE int32_t atomic_cas_int32(int32_t *v, int32_t old, int32_t _new)
@@ -147,7 +147,7 @@ ATOMIC_INLINE int32_t atomic_cas_int32(int32_t *v, int32_t old, int32_t _new)
 
 ATOMIC_INLINE int32_t atomic_fetch_and_add_int32(int32_t *p, int32_t x)
 {
-	return InterlockedExchangeAdd(p, x);
+	return InterlockedExchangeAdd((long *)p, x);
 }
 
 ATOMIC_INLINE int32_t atomic_fetch_and_or_int32(int32_t *p, int32_t x)



More information about the Bf-blender-cvs mailing list