summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-19 16:48:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-07-19 16:48:40 (GMT)
commit7d1f353a6ff2e0302294e2be75fcdd07d0c388be (patch)
tree573da56e123070e398c89dfb65a025292388d4a4 /Utilities
parent04b74f8eda853e91113d0b11bec5c8c4003546fb (diff)
parent1aba3a8367f8e9a6f12e409f170008d930f87855 (diff)
downloadCMake-7d1f353a6ff2e0302294e2be75fcdd07d0c388be.zip
CMake-7d1f353a6ff2e0302294e2be75fcdd07d0c388be.tar.gz
CMake-7d1f353a6ff2e0302294e2be75fcdd07d0c388be.tar.bz2
Merge topic 'libuv-mingw-arm'
1aba3a8367 libuv: Fix building with mingw toolchains for ARM/AArch64 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6354
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibuv/src/win/atomicops-inl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Utilities/cmlibuv/src/win/atomicops-inl.h b/Utilities/cmlibuv/src/win/atomicops-inl.h
index 52713cf..2f984c6 100644
--- a/Utilities/cmlibuv/src/win/atomicops-inl.h
+++ b/Utilities/cmlibuv/src/win/atomicops-inl.h
@@ -39,10 +39,11 @@ static char INLINE uv__atomic_exchange_set(char volatile* target) {
return _InterlockedOr8(target, 1);
}
-#else /* GCC */
+#else /* GCC, Clang in mingw mode */
-/* Mingw-32 version, hopefully this works for 64-bit gcc as well. */
static inline char uv__atomic_exchange_set(char volatile* target) {
+#if defined(__i386__) || defined(__x86_64__)
+ /* Mingw-32 version, hopefully this works for 64-bit gcc as well. */
const char one = 1;
char old_value;
__asm__ __volatile__ ("lock xchgb %0, %1\n\t"
@@ -50,6 +51,9 @@ static inline char uv__atomic_exchange_set(char volatile* target) {
: "0"(one), "m"(*target)
: "memory");
return old_value;
+#else
+ return __sync_fetch_and_or(target, 1);
+#endif
}
#endif