diff options
author | Pixel <pixel@nobis-crew.org> | 2011-12-11 23:37:19 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-12-11 23:37:23 -0800 |
commit | 600e7af66ad53f83fe61a907161e8b295603b83e (patch) | |
tree | 583d5473bd1b68366e39b3b7073d51b09e99f0bb /includes/Exceptions.h | |
parent | 69efca1a157245b35cd80a09718f45b30412dcea (diff) |
Introducing EAssert for 'Execution Assert', which won't stop the application, and will replace a bunch of RAssert around the code.
Diffstat (limited to 'includes/Exceptions.h')
-rw-r--r-- | includes/Exceptions.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/Exceptions.h b/includes/Exceptions.h index 1f65b12..829a5d1 100644 --- a/includes/Exceptions.h +++ b/includes/Exceptions.h @@ -136,6 +136,12 @@ ClassName::ClassName(T * ptr) { Balau::ExitHelper(msg, __VA_ARGS__); \ } +#define EAssert(c, ...) if (!__builtin_expect(!!(c), 0)) { \ + Balau::String msg; \ + msg.set("Execution Assertion " #c " failed at %s:%i", __FILE__, __LINE__); \ + Balau::AssertHelper(msg, __VA_ARGS__); \ +} + #define TAssert(c) if (!__builtin_expect(!!(c), 0)) { \ Balau::String msg; \ msg.set("UnitTest Assert " #c " failed at %s:%i", __FILE__, __LINE__); \ |