diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-30 02:03:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-30 02:03:32 +0300 |
commit | 244991dee7a2e274cb361f5040dd39b0f2997290 (patch) | |
tree | 1561cedb98b1f2df73fb49cc26f48eb14d01e520 /src/utils/checkutils.h | |
parent | 22795c4301cd6b62a8270b45a72a850ed888daf8 (diff) | |
download | ManaVerse-244991dee7a2e274cb361f5040dd39b0f2997290.tar.gz ManaVerse-244991dee7a2e274cb361f5040dd39b0f2997290.tar.bz2 ManaVerse-244991dee7a2e274cb361f5040dd39b0f2997290.tar.xz ManaVerse-244991dee7a2e274cb361f5040dd39b0f2997290.zip |
Extend assert reporting functions with condition text and call stack.
Diffstat (limited to 'src/utils/checkutils.h')
-rw-r--r-- | src/utils/checkutils.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/utils/checkutils.h b/src/utils/checkutils.h index 21f439743..539614a7a 100644 --- a/src/utils/checkutils.h +++ b/src/utils/checkutils.h @@ -23,17 +23,23 @@ #ifdef ENABLE_ASSERTS -#define reportFalse(val) reportFalse1(val, __FILE__, __LINE__) -#define reportFalse1(val, file, line) reportFalseReal(val, file, line) - -#define reportTrue(val) reportTrue1(val, __FILE__, __LINE__) -#define reportTrue1(val, file, line) reportTrueReal(val, file, line) - -bool reportFalseReal(const bool val, const char *const file, - const unsigned line); - -bool reportTrueReal(const bool val, const char *const file, - const unsigned line); +#define reportFalse(val) \ + reportFalseReal(val, #val, __FILE__, __LINE__, __func__) + +#define reportTrue(val) \ + reportTrueReal(val, #val, __FILE__, __LINE__, __func__) + +bool reportFalseReal(const bool val, + const char *const text, + const char *const file, + const unsigned line, + const char *const func); + +bool reportTrueReal(const bool val, + const char *const text, + const char *const file, + const unsigned line, + const char *const func); void reportStack(const char *const file, const unsigned int line, |