Skip to content

Commit

Permalink
Workaround for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
jmroot committed Nov 21, 2022
1 parent e75e612 commit 783604d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Include/pymacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
// static_assert is defined in glibc from version 2.16. Compiler support for
// the C11 _Static_assert keyword is in gcc >= 4.6.

// 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) \
#if !defined(static_assert) && !defined(_MSC_VER) \
&& !(defined(__cplusplus) && __cplusplus >= 201103L)
# define static_assert _Static_assert
#endif
Expand Down

0 comments on commit 783604d

Please sign in to comment.