- #define wxASSERT(cond) wxAssert(!!(cond), __TFILE__, __LINE__, _T(#cond))
-
- /* assert with additional message explaining it's cause */
- #define wxASSERT_MSG(cond, msg) \
- wxAssert(!!(cond), __TFILE__, __LINE__, _T(#cond), msg)
-
- /* an assert helper used to avoid warning when testing constant expressions, */
+ #define wxASSERT(cond) wxASSERT_MSG(cond, 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(__TFILE__, __LINE__, __WXFUNCTION__, _T(#cond), msg)
+ #else
+ #define wxASSERT_MSG(cond, msg) \
+ if ( cond ) \
+ ; \
+ else \
+ wxOnAssert(__TFILE__, __LINE__, __WXFUNCTION__, _T(#cond), msg)
+ #endif
+
+ /* special form of assert: always triggers it (in debug mode) */
+ #define wxFAIL wxFAIL_MSG(NULL)
+
+ /* FAIL with some message */
+ #define wxFAIL_MSG(msg) wxFAIL_COND_MSG("wxAssertFailure", msg)
+
+ /* FAIL with some message and a condition */
+ #define wxFAIL_COND_MSG(cond, msg) \
+ wxOnAssert(__TFILE__, __LINE__, __WXFUNCTION__, _T(cond), msg)
+
+ /* An assert helper used to avoid warning when testing constant expressions, */