Experimental simplification of the code by using MWERKS version
for all compilers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -172,21 +172,13 @@
|
|||||||
|
|
||||||
/* assert with additional message explaining its cause */
|
/* assert with additional message explaining its cause */
|
||||||
|
|
||||||
/* compilers can give a warning (such as "possible unwanted ;") when using */
|
/* Note: some compilers will give a warning (such as */
|
||||||
/* the default definition of wxASSERT_MSG so we provide an alternative */
|
/* "possible unwanted ;") when using a ";" instead of the "{}". */
|
||||||
#if defined(__MWERKS__)
|
#define wxASSERT_MSG(cond, msg) \
|
||||||
#define wxASSERT_MSG(cond, msg) \
|
if ( cond ) \
|
||||||
if ( cond ) \
|
{} \
|
||||||
{} \
|
else \
|
||||||
else \
|
wxOnAssert(__FILE__, __LINE__, __WXFUNCTION__, #cond, msg)
|
||||||
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) */
|
/* special form of assert: always triggers it (in debug mode) */
|
||||||
#define wxFAIL wxFAIL_MSG((const char*)NULL)
|
#define wxFAIL wxFAIL_MSG((const char*)NULL)
|
||||||
@@ -246,28 +238,15 @@
|
|||||||
|
|
||||||
/* as wxCHECK2 but with a message explaining why we fail */
|
/* as wxCHECK2 but with a message explaining why we fail */
|
||||||
|
|
||||||
/* see comment near the definition of wxASSERT_MSG for the # if/else reason */
|
#define wxCHECK2_MSG(cond, op, msg) \
|
||||||
#if defined(__MWERKS__)
|
if ( cond ) \
|
||||||
#define wxCHECK2_MSG(cond, op, msg) \
|
{} \
|
||||||
if ( cond ) \
|
else \
|
||||||
{} \
|
{ \
|
||||||
else \
|
wxFAIL_COND_MSG(#cond, msg); \
|
||||||
{ \
|
op; \
|
||||||
wxFAIL_COND_MSG(#cond, msg); \
|
} \
|
||||||
op; \
|
struct wxDummyCheckStruct /* just to force a semicolon */
|
||||||
} \
|
|
||||||
struct wxDummyCheckStruct /* just to force a semicolon */
|
|
||||||
#else
|
|
||||||
#define wxCHECK2_MSG(cond, op, msg) \
|
|
||||||
if ( cond ) \
|
|
||||||
; \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
wxFAIL_COND_MSG(#cond, msg); \
|
|
||||||
op; \
|
|
||||||
} \
|
|
||||||
struct wxDummyCheckStruct /* just to force a semicolon */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* special form of wxCHECK2: as wxCHECK, but for use in void functions */
|
/* special form of wxCHECK2: as wxCHECK, but for use in void functions */
|
||||||
/* */
|
/* */
|
||||||
|
Reference in New Issue
Block a user