From d184768bbc333af0b34e860839d71c1bd310f7e4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 24 Sep 2017 23:53:33 +0200 Subject: Core/Misc: Improved error message reported by ASSERT_NOTNULL --- src/common/Debugging/Errors.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/common/Debugging') diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h index c21972af906..fbf4dddbf07 100644 --- a/src/common/Debugging/Errors.h +++ b/src/common/Debugging/Errors.h @@ -55,10 +55,13 @@ namespace Trinity #define ASSERT WPAssert #define ABORT WPAbort -template inline T* ASSERT_NOTNULL(T* pointer) +template +inline T* ASSERT_NOTNULL_IMPL(T* pointer, char const* expr) { - ASSERT(pointer); + ASSERT(pointer, "%s", expr); return pointer; } +#define ASSERT_NOTNULL(pointer) ASSERT_NOTNULL_IMPL(pointer, #pointer) + #endif -- cgit v1.2.3