Second ivl_assert patch
This patch adds a do/while around the conditional
This commit is contained in:
parent
5dd67d8571
commit
2d83955182
|
|
@ -23,11 +23,13 @@
|
||||||
# include <cstdlib>
|
# include <cstdlib>
|
||||||
|
|
||||||
#define ivl_assert(tok, expression) \
|
#define ivl_assert(tok, expression) \
|
||||||
|
do { \
|
||||||
if (! (expression)) { \
|
if (! (expression)) { \
|
||||||
cerr << (tok).get_fileline() << ": assert: " \
|
cerr << (tok).get_fileline() << ": assert: " \
|
||||||
<< __FILE__ << ":" << __LINE__ \
|
<< __FILE__ << ":" << __LINE__ \
|
||||||
<< ": failed assertion " << #expression << endl; \
|
<< ": failed assertion " << #expression << endl; \
|
||||||
abort(); \
|
abort(); \
|
||||||
}
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue