Rework ivl_assert to be simpler and to use the correct incude file.
This commit is contained in:
parent
a359cc301c
commit
5dd67d8571
17
ivl_assert.h
17
ivl_assert.h
|
|
@ -20,21 +20,14 @@
|
|||
#ifndef __ivl_assert_h
|
||||
#define __ivl_assert_h
|
||||
|
||||
# include <cassert>
|
||||
# include <cstdlib>
|
||||
|
||||
#define ivl_assert(tok, expression) \
|
||||
do { \
|
||||
if (! (expression)) \
|
||||
__ivl_assert(#expression, tok, __FILE__, __LINE__); \
|
||||
} while(0)
|
||||
|
||||
#define __ivl_assert(expression, tok, file, line) \
|
||||
do { \
|
||||
if (! (expression)) { \
|
||||
cerr << (tok).get_fileline() << ": assert: " \
|
||||
<< file << ":" << line \
|
||||
<< ": failed assertion " << (expression) << endl; \
|
||||
<< __FILE__ << ":" << __LINE__ \
|
||||
<< ": failed assertion " << #expression << endl; \
|
||||
abort(); \
|
||||
} while(0)
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue