Skip to content

Commit 2e1c616

Browse files
committed
py/misc.h: test for __cplusplus and __clang__ more carefully
1 parent 802380d commit 2e1c616

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/misc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ typedef unsigned int uint;
5454
#define MP_STRINGIFY(x) MP_STRINGIFY_HELPER(x)
5555

5656
// Static assertion macro
57-
#if __cplusplus
57+
#if defined(__cplusplus)
5858
#define MP_STATIC_ASSERT(cond) static_assert((cond), #cond)
5959
#elif __GNUC__ >= 5 || __STDC_VERSION__ >= 201112L
6060
#define MP_STATIC_ASSERT(cond) _Static_assert((cond), #cond)
@@ -70,7 +70,7 @@ typedef unsigned int uint;
7070
#if defined(_MSC_VER) || defined(__cplusplus)
7171
#define MP_STATIC_ASSERT_NONCONSTEXPR(cond) ((void)1)
7272
#else
73-
#if __clang__
73+
#if defined(__clang__)
7474
#pragma GCC diagnostic ignored "-Wgnu-folding-constant"
7575
#endif
7676
#define MP_STATIC_ASSERT_NONCONSTEXPR(cond) ((void)sizeof(char[1 - 2 * !(cond)]))

0 commit comments

Comments
 (0)