aboutsummaryrefslogtreecommitdiff
path: root/src/common/Debugging/Errors.h
diff options
context:
space:
mode:
authorStormBytePP <stormbyte@gmail.com>2015-09-21 15:09:41 +0200
committerStormBytePP <stormbyte@gmail.com>2015-09-21 15:11:06 +0200
commit7b245a0b6b9902ebea98d2a945d4ee0e26a62681 (patch)
treea30ef097011505ac095c267fc2f667fadac409bd /src/common/Debugging/Errors.h
parentff71da2b05210c1d0ed088ef12b06bf4632ff830 (diff)
Core: Added ABORT() macro to prevent the usage of ASSERT(false) as a quick hack to crash the core misusing assert
Diffstat (limited to 'src/common/Debugging/Errors.h')
-rw-r--r--src/common/Debugging/Errors.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h
index 4d4624b63dd..edf56b29136 100644
--- a/src/common/Debugging/Errors.h
+++ b/src/common/Debugging/Errors.h
@@ -29,6 +29,8 @@ namespace Trinity
DECLSPEC_NORETURN void Fatal(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
DECLSPEC_NORETURN void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
+
+ DECLSPEC_NORETURN void Abort(char const* file, int line, char const* function) ATTR_NORETURN;
void Warning(char const* file, int line, char const* function, char const* message);
@@ -46,8 +48,10 @@ namespace Trinity
#define WPFatal(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
#define WPError(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
+#define WPAbort() ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END
#define ASSERT WPAssert
+#define ABORT WPAbort
template <typename T> inline T* ASSERT_NOTNULL(T* pointer)
{