X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b16f24dd05b14835e5701aa4434747fe5f94169a..86ac84b8ce086e6bbda58f422d41f84268606e35:/include/wx/debug.h diff --git a/include/wx/debug.h b/include/wx/debug.h index 41ec9bbba2..593af341d7 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -105,7 +105,7 @@ extern WXDLLIMPEXP_DATA_BASE(wxAssertHandler_t) wxTheAssertHandler; While usually it is enough -- and more convenient -- to just override OnAssertFailure(), to handle all assertion failures, including those - occurring even before wxApp object creation of after its destruction you + occurring even before wxApp object creation or after its destruction you need to provide your assertion handler function. This function also provides a simple way to disable all asserts: simply @@ -128,7 +128,7 @@ inline wxAssertHandler_t wxSetAssertHandler(wxAssertHandler_t handler) #else // !wxDEBUG_LEVEL -// provide empty subs in case assertions are completely disabled +// provide empty stubs in case assertions are completely disabled // // NB: can't use WXUNUSED() here as we're included from wx/defs.h before it is // defined @@ -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 // usually used in normally unreachable code) #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 wxFAIL_MSG((const char*)NULL) #else // !wxDEBUG_LEVEL