+ extern void WXDLLIMPEXP_BASE wxOnAssert(const char *szFile,
+ int nLine,
+ const char *szFunc,
+ const char *szCond,
+ const wxChar *szMsg);
+#endif // wxUSE_UNICODE
+
+ class WXDLLIMPEXP_BASE wxString;
+ class WXDLLIMPEXP_BASE wxCStrData;
+
+ /* these two work when szMsg passed to debug macro is a string,
+ we also have to provide wxCStrData overload to resolve ambiguity
+ which would otherwise arise from wxASSERT( s.c_str() ): */
+ extern void WXDLLIMPEXP_BASE wxOnAssert(const wxString& szFile,
+ int nLine,
+ const wxString& szFunc,
+ const wxString& szCond,
+ const wxString& szMsg);
+
+ extern void WXDLLIMPEXP_BASE wxOnAssert(const wxString& szFile,
+ int nLine,
+ const wxString& szFunc,
+ const wxString& szCond);
+
+ extern void WXDLLIMPEXP_BASE wxOnAssert(const char *szFile,
+ int nLine,
+ const char *szFunc,
+ const char *szCond,
+ const wxCStrData& msg);
+
+ extern void WXDLLIMPEXP_BASE wxOnAssert(const char *szFile,
+ int nLine,
+ const char *szFunc,
+ const char *szCond,
+ const wxString& szMsg);
+
+ /* call this function to break into the debugger unconditionally (assuming */
+ /* the program is running under debugger, of course) */
+ extern void WXDLLIMPEXP_BASE wxTrap();
+
+ /* generic assert macro */
+ #define wxASSERT(cond) wxASSERT_MSG(cond, (const char*)NULL)
+
+
+ /* assert with additional message explaining its cause */
+
+ /* compilers can give a warning (such as "possible unwanted ;") when using */
+ /* the default definition of wxASSERT_MSG so we provide an alternative */
+ #if defined(__MWERKS__)
+ #define wxASSERT_MSG(cond, msg) \
+ if ( cond ) \
+ {} \
+ else \
+ wxOnAssert(__FILE__, __LINE__, __WXFUNCTION__, #cond, msg)
+ #else
+ #define wxASSERT_MSG(cond, msg) \
+ if ( cond ) \
+ ; \
+ else \
+ wxOnAssert(__FILE__, __LINE__, __WXFUNCTION__, #cond, msg)
+ #endif