Skip to content

Commit 6c36647

Browse files
committed
Restrict static_assert define to gcc/clang C11+
1 parent 08106d7 commit 6c36647

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Include/pymacro.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// MSVC makes static_assert a keyword, contrary to the C standard.
1616
//
1717
// In C++ 11 static_assert is a keyword, redefining is undefined behaviour.
18-
#if !defined(static_assert) && !defined(_MSC_VER) \
19-
&& !(defined(__cplusplus) && __cplusplus >= 201103L)
18+
#if !defined(static_assert) && defined(__GNUC__) \
19+
&& defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2020
# define static_assert _Static_assert
2121
#endif
2222

0 commit comments

Comments
 (0)