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