37 #ifndef THROWINGASSERT_H
38 #define THROWINGASSERT_H
50 virtual const char *
what()
const throw();
55 bool __ASSERT(
const char *exp,
const char *file,
int line,
const char *func,
bool die) __attribute__((noreturn));
57 bool __ASSERT(
const char *exp,
const char *file,
int line,
const char *func,
bool die,
const std::string &msg) __attribute__((noreturn));
59 bool __ASSERT(
const char *exp,
const char *file,
int line,
const char *func,
bool die,
const char *fmt, ...) __attribute__((noreturn));
62 #define ASSERT(exp, ...) (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, false, ## __VA_ARGS__))
63 #define ASSERT_ABORT(exp, ...) (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, true, ## __VA_ARGS__))
64 #define ENSURE(exp, ...) (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, false, ## __VA_ARGS__))
65 #define ENSURE_ABORT(exp, ...) (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, true, ## __VA_ARGS__))
67 #define ASSERT(exp, ...)
68 #define ASSERT_ABORT(exp, ...)
69 #define ENSURE(exp, ...) exp
70 #define ENSURE_ABORT(exp, ...) exp
bool __ASSERT(const char *exp, const char *file, int line, const char *func, bool die) __attribute__((noreturn))
The exception thrown by the ASSERT macro.
AssertException(const std::string &msg)
virtual ~AssertException()
virtual const char * what() const