Skip to content

Commit

Permalink
Add workaround for atomics with Clang on Windows
Browse files Browse the repository at this point in the history
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
quixdb/squash#185
  • Loading branch information
jibsen committed Jun 15, 2016
1 parent a0e6c91 commit b293287
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions munit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdatomic.h>
# define ATOMIC_UINT32_T _Atomic uint32_t
Expand Down

0 comments on commit b293287

Please sign in to comment.