- /* 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
-
- /* special form of assert: always triggers it (in debug mode) */
- #define wxFAIL wxFAIL_MSG((const char*)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(__FILE__, __LINE__, __WXFUNCTION__, cond, msg)
-
- /* An assert helper used to avoid warning when testing constant expressions, */
- /* i.e. wxASSERT( sizeof(int) == 4 ) can generate a compiler warning about */
- /* expression being always true, but not using */
- /* wxASSERT( wxAssertIsEqual(sizeof(int), 4) ) */
- /* */
- /* NB: this is made obsolete by wxCOMPILE_TIME_ASSERT() and should no */
- /* longer be used. */
- extern bool WXDLLIMPEXP_BASE wxAssertIsEqual(int x, int y);
-#else
- #define wxTrap()
-
- /* nothing to do in release mode (hopefully at this moment there are */
- /* no more bugs ;-) */
- #define wxASSERT(cond)
- #define wxASSERT_MSG(cond, msg)
- #define wxFAIL
- #define wxFAIL_MSG(msg)
- #define wxFAIL_COND_MSG(cond, msg)
-#endif /* __WXDEBUG__ */
-
-#ifdef __cplusplus
- /* Use of wxFalse instead of false suppresses compiler warnings about testing */
- /* constant expression */
- extern WXDLLIMPEXP_DATA_BASE(const bool) wxFalse;
-#endif