diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h index 428e7653db2..d263be3efed 100644 --- a/src/common/Debugging/Errors.h +++ b/src/common/Debugging/Errors.h @@ -70,10 +70,13 @@ TC_COMMON_API std::string GetDebugInfo(); #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