Disable CHECK calls when not debugging
This commit is contained in:
parent
0c86a8b240
commit
76ffb05c23
13
debug.hpp
13
debug.hpp
@ -83,8 +83,15 @@
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define CHECK_HARD(C) _CHECK_META((C), { ; }, { panic (); })
|
#if defined(ENABLE_DEBUGGING)
|
||||||
#define CHECK_SOFT(C) _CHECK_META((C), { ; }, { breakpoint (); })
|
#define CHECK_HARD(C) _CHECK_META((C), { ; }, { panic (); })
|
||||||
|
#define CHECK_SOFT(C) _CHECK_META((C), { ; }, { breakpoint (); })
|
||||||
|
#define CHECK(C) CHECK_HARD(C)
|
||||||
|
#else
|
||||||
|
#define CHECK_HARD(C) { };
|
||||||
|
#define CHECK_SOFT(C) { };
|
||||||
|
#define CHECK(C) CHECK_SOFT(C)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define CHECK_EQ(A,B) do { \
|
#define CHECK_EQ(A,B) do { \
|
||||||
@ -131,8 +138,6 @@
|
|||||||
panic ("expected exception: " #E); \
|
panic ("expected exception: " #E); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define CHECK(C) CHECK_HARD(C)
|
|
||||||
|
|
||||||
|
|
||||||
class panic_error {
|
class panic_error {
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user