fix: stdatomic.h compatibility with gcc -std=c11/c17/...
Newer versions of gcc has __has_feature(x) macro, too, and returns true on c_atomic, though it does not support Clang-flavored atomic builtins.
This commit is contained in:
+3
-3
@@ -49,10 +49,10 @@
|
||||
#endif
|
||||
|
||||
#if !defined(__CLANG_ATOMICS) && !defined(__GNUC_ATOMICS)
|
||||
#if __has_feature(c_atomic)
|
||||
#define __CLANG_ATOMICS
|
||||
#elif __GNUC_PREREQ__(4, 7)
|
||||
#if __GNUC_PREREQ__(4, 7)
|
||||
#define __GNUC_ATOMICS
|
||||
#elif __has_feature(c_atomic)
|
||||
#define __CLANG_ATOMICS
|
||||
#elif !defined(__GNUC__)
|
||||
#error "stdatomic.h does not support your compiler"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user