Core/Misc: Improved error message reported by ASSERT_NOTNULL

This commit is contained in:
Shauren
2017-09-24 23:53:33 +02:00
parent 0fcf6043b7
commit d184768bbc

View File

@@ -55,10 +55,13 @@ namespace Trinity
#define ASSERT WPAssert
#define ABORT WPAbort
template <typename T> inline T* ASSERT_NOTNULL(T* pointer)
template <typename T>
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