don't crash in wxFAIL and wxCHECK if assertion handler is NULL

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-03-25 13:31:38 +00:00
parent 1087c6c1c6
commit cf58616239

View File

@@ -259,7 +259,10 @@ extern void WXDLLIMPEXP_BASE wxOnAssert(const char *file,
// wxFAIL is a special form of assert: it always triggers (and so is // wxFAIL is a special form of assert: it always triggers (and so is
// usually used in normally unreachable code) // usually used in normally unreachable code)
#define wxFAIL_COND_MSG(cond, msg) \ #define wxFAIL_COND_MSG(cond, msg) \
wxOnAssert(__FILE__, __LINE__, __WXFUNCTION__, cond, msg) if ( !wxTheAssertHandler ) \
{} \
else \
wxOnAssert(__FILE__, __LINE__, __WXFUNCTION__, cond, msg)
#define wxFAIL_MSG(msg) wxFAIL_COND_MSG("Assert failure", msg) #define wxFAIL_MSG(msg) wxFAIL_COND_MSG("Assert failure", msg)
#define wxFAIL wxFAIL_MSG((const char*)NULL) #define wxFAIL wxFAIL_MSG((const char*)NULL)
#else // !wxDEBUG_LEVEL #else // !wxDEBUG_LEVEL