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:
@@ -259,6 +259,9 @@ 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) \
|
||||||
|
if ( !wxTheAssertHandler ) \
|
||||||
|
{} \
|
||||||
|
else \
|
||||||
wxOnAssert(__FILE__, __LINE__, __WXFUNCTION__, cond, msg)
|
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)
|
||||||
|
Reference in New Issue
Block a user