summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-07-24 08:07:08 +0200
committerGitHub <noreply@github.com>2017-07-24 08:07:08 +0200
commit574ec97b8b5cb5afc6bc39f7f9a065fed8ba58c1 (patch)
tree675ec3a4670ef5d204f3d8312e602b22188c7f22
parentb31973b64de038a1d2dfaa1fcea0c72ee5ce012b (diff)
parentf514fabf61e122880c1c184fe57bccfe2388b57d (diff)
Merge pull request #9802 from vnen/fix-uwp-build
UWP: Fix build issue caused by atomic operations
-rw-r--r--core/safe_refcount.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp
index d18c90adfa..d7e5297321 100644
--- a/core/safe_refcount.cpp
+++ b/core/safe_refcount.cpp
@@ -185,7 +185,7 @@ static _ALWAYS_INLINE_ uint64_t _atomic_increment_impl(register uint64_t *pw) {
static _ALWAYS_INLINE_ uint64_t _atomic_sub_impl(register uint64_t *pw, register uint64_t val) {
-#if _WIN32_WINNT >= 0x0601 // Windows 7+
+#if _WIN32_WINNT >= 0x0601 && !defined(UWP_ENABLED) // Windows 7+ except UWP
return InterlockedExchangeSubtract64(pw, val) - val;
#else
return InterlockedExchangeAdd64((LONGLONG volatile *)pw, -(int64_t)val) - val;