mirror of https://github.com/microsoft/vcpkg.git
23 lines
887 B
Diff
23 lines
887 B
Diff
diff --git a/src/engine/engine_crossplatform.h b/src/engine/engine_crossplatform.h
|
|
index 2cf6dff..f89cbd1 100644
|
|
--- a/src/engine/engine_crossplatform.h
|
|
+++ b/src/engine/engine_crossplatform.h
|
|
@@ -71,9 +71,14 @@
|
|
|
|
// Atomics helper for size_t.
|
|
#if defined(_MSC_VER) && !defined(__clang__)
|
|
- #include <intrin.h>
|
|
- #define mj_atomic_add_size_t(ptr, val) \
|
|
- (size_t)_InterlockedExchangeAdd64((__int64 volatile*)(ptr), (__int64)(val))
|
|
+ #include <intrin.h>
|
|
+ #if defined(_WIN64)
|
|
+ #define mj_atomic_add_size_t(ptr, val) \
|
|
+ (size_t)_InterlockedExchangeAdd64((__int64 volatile*)(ptr), (__int64)(val))
|
|
+ #else
|
|
+ #define mj_atomic_add_size_t(ptr, val) \
|
|
+ (size_t)_InterlockedExchangeAdd((long volatile*)(ptr), (long)(val))
|
|
+ #endif
|
|
#else
|
|
#define mj_atomic_add_size_t(ptr, val) \
|
|
__atomic_fetch_add(ptr, val, __ATOMIC_RELAXED)
|