diff options
Diffstat (limited to 'src/common/Debugging')
| -rw-r--r-- | src/common/Debugging/Errors.cpp | 6 | ||||
| -rw-r--r-- | src/common/Debugging/Errors.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp index cebd9d4cf2f..4612fcb7910 100644 --- a/src/common/Debugging/Errors.cpp +++ b/src/common/Debugging/Errors.cpp @@ -72,4 +72,10 @@ void Warning(char const* file, int line, char const* function, char const* messa file, line, function, message); } +void Abort(char const* file, int line, char const* function) +{ + fprintf(stderr, "\n%s:%i in %s ABORTED.\n", + file, line, function, message); +} + } // namespace Trinity diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h index 4d4624b63dd..024c5981c72 100644 --- a/src/common/Debugging/Errors.h +++ b/src/common/Debugging/Errors.h @@ -46,8 +46,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) { |
