From 600e7af66ad53f83fe61a907161e8b295603b83e Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 11 Dec 2011 23:37:19 -0800 Subject: Introducing EAssert for 'Execution Assert', which won't stop the application, and will replace a bunch of RAssert around the code. --- includes/Exceptions.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'includes/Exceptions.h') 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__); \ -- cgit v1.2.3