chiark / gitweb /
utils/macros.h (STATIC_ASSERT): Boolean-canonify the expression.
[mLib] / utils / macros.h
index a5263e19ed319ef09d795284a52370706450e28b..45420e2232d1210ae55c4643b825bdb7103d3333 100644 (file)
@@ -51,7 +51,7 @@
 #define GLUE(x, y) MLIB__GLUE(x, y)
 
 #ifdef static_assert
-#  define STATIC_ASSERT(cond, msg) static_assert(cond, msg)
+#  define STATIC_ASSERT(cond, msg) static_assert(!!(cond), msg)
 #else
 #  define STATIC_ASSERT(cond, msg)                                     \
        IGNORABLE extern char static_assert_failed[2*!!(cond) - 1]