From d7d6e7214cc1af22dab0b28fdde218ea7d37f05f Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 6 Dec 2015 15:18:01 +0100 Subject: Added backtrace in case an invalid race is passed to map_race_id2mask Signed-off-by: Haru --- src/common/nullpo.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/common/nullpo.h') diff --git a/src/common/nullpo.h b/src/common/nullpo.h index 52e9fba39..8abeb4af9 100644 --- a/src/common/nullpo.h +++ b/src/common/nullpo.h @@ -27,10 +27,23 @@ #include #endif // !DEFCPP && WIN && !MINGW #define Assert(EX) assert(EX) +/** + * Reports an assertion failure if the passed expression is false. + * + * @param EX The expression to test. + * @return false if the passed expression is true, false otherwise. + */ #define Assert_chk(EX) ( (EX) ? false : (nullpo->assert_report(__FILE__, __LINE__, __func__, #EX, "failed assertion"), true) ) +/** + * Reports an assertion failure (without actually checking it). + * + * @param EX the expression to report. + */ +#define Assert_report(EX) (nullpo->assert_report(__FILE__, __LINE__, __func__, #EX, "failed assertion")) #else // ! ASSERT_CHECK #define Assert(EX) (EX) #define Assert_chk(EX) ((EX), false) +#define Assert_report(EX) ((void)(EX)) #endif // ASSERT_CHECK #if defined(NULLPO_CHECK) -- cgit v1.2.3-60-g2f50