Skip to content
Snippets Groups Projects
Commit 7d1f353a authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'libuv-mingw-arm'


1aba3a83 libuv: Fix building with mingw toolchains for ARM/AArch64

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !6354
parents 04b74f8e 1aba3a83
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment