Skip to content

Commit 91389b5

Browse files
committed
Check explicitly if __STDC_VERSION__ is defined
1 parent 57db3b8 commit 91389b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Include/pymacro.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/* Argument must be a char or an int in [-128, 127] or [0, 255]. */
4747
#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
4848

49-
#if __STDC_VERSION__ >= 201112L
49+
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
5050
# define Py_BUILD_ASSERT_EXPR(cond) \
5151
(sizeof(struct { _Static_assert(cond, #cond); int dummy; }), \
5252
0)
@@ -68,7 +68,7 @@
6868
(sizeof(char [1 - 2*!(cond)]) - 1)
6969
#endif
7070

71-
#if __STDC_VERSION__ >= 201112L
71+
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
7272
// Use static_assert() on C11 and newer
7373
# define Py_BUILD_ASSERT(cond) static_assert((cond), #cond)
7474
#else

0 commit comments

Comments
 (0)