Skip to content

Commit

Permalink
Restrict static_assert define to gcc/clang C11+
Browse files Browse the repository at this point in the history
  • Loading branch information
jmroot committed Nov 21, 2022
1 parent 08106d7 commit 6c36647
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Include/pymacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// MSVC makes static_assert a keyword, contrary to the C standard.
//
// In C++ 11 static_assert is a keyword, redefining is undefined behaviour.
#if !defined(static_assert) && !defined(_MSC_VER) \
&& !(defined(__cplusplus) && __cplusplus >= 201103L)
#if !defined(static_assert) && defined(__GNUC__) \
&& defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
# define static_assert _Static_assert
#endif

Expand Down

0 comments on commit 6c36647

Please sign in to comment.