Core/Misc: Improved error message reported by ASSERT_NOTNULL

(cherry picked from commit d184768bbc)
This commit is contained in:
Shauren
2017-09-24 23:53:33 +02:00
committed by jackpoz
parent 78f70cbff2
commit cd6d57e2e7

View File

@@ -70,10 +70,13 @@ TC_COMMON_API std::string GetDebugInfo();
#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