X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/657a8a359826e46a7fc458216403f54deca34989..3569e0d042fa09417c2777b3da833a1df5096e06:/include/wx/debug.h diff --git a/include/wx/debug.h b/include/wx/debug.h index 59b2d61d37..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 @@ -276,8 +279,8 @@ extern void WXDLLIMPEXP_BASE wxOnAssert(const char *file, #define wxASSERT_LEVEL_2_MSG(cond, msg) wxASSERT_MSG(cond, msg) #define wxASSERT_LEVEL_2(cond) wxASSERT(cond) #else // wxDEBUG_LEVEL < 2 - #define wxASSERT_LEVEL_2_MSG - #define wxASSERT_LEVEL_2 + #define wxASSERT_LEVEL_2_MSG(cond, msg) + #define wxASSERT_LEVEL_2(cond) #endif