From 3b32df32afb76695cc1c51cf7f3a0424eb0d9334 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sat, 5 Jul 2008 17:54:03 +0000 Subject: [PATCH] Fixed Digital Mars breakage as suggested by Vadim on mailing list (#9619). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/debug.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/wx/debug.h b/include/wx/debug.h index 86856c59d3..84f101d15f 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -190,6 +190,17 @@ /* as wxCHECK2 but with a message explaining why we fail */ +#ifdef __GNUC__ + #define wxFORCE_SEMICOLON typedef int wxDummyCheckInt + /* Note: old gcc versions (e.g. 2.8) give an internal compiler error */ + /* on a simple forward declaration, when used in a template */ + /* function, so rather use a dummy typedef which does work... */ +#else + #define wxFORCE_SEMICOLON struct wxDummyCheckStruct + /* Note2: however, some other compilers (notably Digital Mars */ + /* don't like multiple typedefs (even though the standard */ + /* does allow them), so use a forward declaration for non-gcc. */ +#endif /* see comment near the definition of wxASSERT_MSG for the # if/else reason */ #if defined(__MWERKS__) #define wxCHECK2_MSG(cond, op, msg) \ @@ -210,10 +221,7 @@ wxFAIL_COND_MSG(#cond, msg); \ op; \ } \ - typedef int wxDummyCheckInt /* just to force a semicolon */ - /* NB: old gcc versions (e.g. 2.8) give an internal compiler error */ - /* on a simple forward declaration, when used in a template */ - /* function, so rather use a dummy typedef which does work... */ + wxFORCE_SEMICOLON /* just to force a semicolon */ #endif /* special form of wxCHECK2: as wxCHECK, but for use in void functions */