File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 15
15
// MSVC makes static_assert a keyword in C11-17, contrary to the standards.
16
16
//
17
17
// In C++11 and C2x, static_assert is a keyword, redefining is undefined
18
- // behaviour. So only define if building as C (if __STDC_VERSION__ is defined),
19
- // not C++ , and only for C11-17.
18
+ // behaviour. So only define if building as C, not C++ (if __cplusplus is
19
+ // not defined) , and only for C11-17.
20
20
#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \
21
- && defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 201112L \
22
- && __STDC_VERSION__ <= 201710L
21
+ && ! defined(__cplusplus ) && defined( __STDC_VERSION__) \
22
+ && __STDC_VERSION__ >= 201112L && __STDC_VERSION__ <= 201710L
23
23
# define static_assert _Static_assert
24
24
#endif
25
25
47
47
#define Py_CHARMASK (c ) ((unsigned char )((c) & 0xff ))
48
48
49
49
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
50
- && !defined(_MSC_VER))
50
+ && !defined(__cplusplus) && !defined( _MSC_VER))
51
51
# define Py_BUILD_ASSERT_EXPR (cond ) \
52
52
((void )sizeof (struct { int dummy; _Static_assert(cond, #cond); }), \
53
53
0 )
You can’t perform that action at this time.
0 commit comments