From b29328732ecdf7cfff9d37fe083bf6f7195c8b1b Mon Sep 17 00:00:00 2001 From: Joergen Ibsen Date: Wed, 15 Jun 2016 10:02:36 +0200 Subject: [PATCH] Add workaround for atomics with Clang on Windows Clang 3.8.0 on mingw-w64 advertises support for both C11 and Clang atomics, but only Clang atomics work. With Clang/C2 neither works. http://llvm.org/bugs/show_bug.cgi?id=26911 https://github.com/quixdb/squash/issues/185 --- munit.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/munit.c b/munit.c index b97b048..d13590c 100644 --- a/munit.c +++ b/munit.c @@ -277,6 +277,14 @@ munit_malloc_ex(const char* filename, int line, size_t size) { # endif #endif +/* Workaround for http://llvm.org/bugs/show_bug.cgi?id=26911 */ +#if defined(__clang__) && defined(_WIN32) +# undef HAVE_STDATOMIC +# if defined(__c2__) +# undef HAVE_CLANG_ATOMICS +# endif +#endif + #if defined(HAVE_STDATOMIC) # include # define ATOMIC_UINT32_T _Atomic uint32_t