diff options
Diffstat (limited to 'src/libnm-std-aux/nm-std-aux.h')
-rw-r--r-- | src/libnm-std-aux/nm-std-aux.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h index 1e341157fc..49ec8aab0c 100644 --- a/src/libnm-std-aux/nm-std-aux.h +++ b/src/libnm-std-aux/nm-std-aux.h @@ -182,11 +182,10 @@ typedef uint64_t _nm_bitwise nm_be64_t; }) #define NM_STATIC_ASSERT(cond) static_assert(cond, "") -#define NM_STATIC_ASSERT_EXPR(cond) \ - ({ \ - NM_STATIC_ASSERT(cond); \ - 1; \ - }) +#define NM_STATIC_ASSERT_EXPR_1(cond) \ + (sizeof(struct { char __static_assert_expr_1[(cond) ? 1 : -1]; }) == 1) +#define NM_STATIC_ASSERT_EXPR_VOID(cond) \ + ((void) (sizeof(struct { char __static_assert_expr_void[(cond) ? 1 : -1]; }) == 1)) /*****************************************************************************/ |