diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-02 14:38:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-02 14:38:09 +0300 |
commit | 18d08ede22e20e46aa75957ce09543c788c64460 (patch) | |
tree | 3db0e9c1aa621b99b8d3ad67328b4d79779c8e37 | |
parent | 4e60462881f1f49b4e85784c4e2ce36669d95af7 (diff) |
Fixes for atomic operations when building with MSVC
-rw-r--r-- | intern/atomic/atomic_ops.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/atomic/atomic_ops.h b/intern/atomic/atomic_ops.h index f63ff630c40..06a5c8d834e 100644 --- a/intern/atomic/atomic_ops.h +++ b/intern/atomic/atomic_ops.h @@ -34,6 +34,11 @@ #if defined (__APPLE__) # include <libkern/OSAtomic.h> #elif defined(_MSC_VER) +# define NOGDI +# ifndef NOMINMAX +# define NOMINMAX +# endif +# define WIN32_LEAN_AND_MEAN # include <windows.h> #elif defined(__arm__) /* Attempt to fix compilation error on Debian armel kernel. @@ -97,13 +102,13 @@ atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new) ATOMIC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x) { - return InterlockedExchangeAdd64(p, x); + return InterlockedExchangeAdd64((int64_t *)p, (int64_t)x); } ATOMIC_INLINE uint64_t atomic_sub_uint64(uint64_t *p, uint64_t x) { - return InterlockedExchangeAdd64(p, -((int64_t)x)); + return InterlockedExchangeAdd64((int64_t *)p, -((int64_t)x)); } ATOMIC_INLINE uint64_t |