Skip to content

Commit 2240f3b

Browse files
committed
Workaround for MSVC
1 parent d85f456 commit 2240f3b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Include/pymacro.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
// static_assert is defined in glibc from version 2.16. Compiler support for
1313
// the C11 _Static_assert keyword is in gcc >= 4.6.
1414

15+
// MSVC makes static_assert a keyword, contrary to the C standard.
16+
1517
// In C++ 11 static_assert is a keyword, redefining is undefined behaviour.
16-
#if !defined(static_assert) \
18+
#if !defined(static_assert) && !defined(_MSC_VER) \
1719
&& !(defined(__cplusplus) && __cplusplus >= 201103L)
1820
# define static_assert _Static_assert
1921
#endif

0 commit comments

Comments
 (0)