chiark
/
gitweb
/
~mdw
/
mLib
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
utils/macros.h (STATIC_ASSERT): Boolean-canonify the expression.
[mLib]
/
utils
/
macros.h
diff --git
a/utils/macros.h
b/utils/macros.h
index a5263e19ed319ef09d795284a52370706450e28b..45420e2232d1210ae55c4643b825bdb7103d3333 100644
(file)
--- a/
utils/macros.h
+++ b/
utils/macros.h
@@
-51,7
+51,7
@@
#define GLUE(x, y) MLIB__GLUE(x, y)
#ifdef static_assert
#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]
#else
# define STATIC_ASSERT(cond, msg) \
IGNORABLE extern char static_assert_failed[2*!!(cond) - 1]