File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 17
17
#elif _MSC_VER
18
18
#include <intrin.h>
19
19
#define MSC_ATOMICS
20
+ #elif defined(__GNUC__ ) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >=8 ))
21
+ #define GCC_ATOMICS
22
+ #elif defined(__clang__ )
23
+ #if __has_builtin (__atomic_load )
24
+ #define GCC_ATOMICS
25
+ #endif
20
26
#else
21
- #error "no support for missing C11 atomics except with MSVC "
27
+ #error "no supported atomic implementation for this platform/compiler "
22
28
#endif
23
29
24
30
@@ -33,10 +39,13 @@ static inline npy_uint8 npy_atomic_load_uint8(const npy_uint8 *obj) {
33
39
#else
34
40
#error "Unsupported MSVC build configuration, neither x86 or ARM"
35
41
#endif
42
+ #elif defined(GCC_ATOMICS )
43
+ return __atomic_load_n (obj , __ATOMIC_SEQ_CST );
36
44
#endif
37
45
}
38
46
39
47
#undef MSC_ATOMICS
40
48
#undef STDC_ATOMICS
49
+ #undef GCC_ATOMICS
41
50
42
51
#endif // NUMPY_CORE_SRC_COMMON_NPY_NPY_ATOMIC_H_
You can’t perform that action at this time.
0 commit comments