From: Paul Cornett Date: Fri, 19 May 2006 16:57:07 +0000 (+0000) Subject: using defined in a macro has undefined behavior X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/49ca2a9920152f2e4fe57207a1ee01245b477873 using defined in a macro has undefined behavior git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/platform.h b/include/wx/platform.h index b796ce8ecf..8d82a9ef3a 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -516,10 +516,13 @@ ... no gcc at all or gcc < 3.1 ... # endif */ -#define wxCHECK_GCC_VERSION( major, minor ) \ - ( defined(__GNUC__) && defined(__GNUC_MINOR__) \ - && ( ( __GNUC__ > (major) ) \ - || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) ) +#if defined(__GNUC__) && defined(__GNUC_MINOR__) + #define wxCHECK_GCC_VERSION( major, minor ) \ + ( ( __GNUC__ > (major) ) \ + || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) +#else + #define wxCHECK_GCC_VERSION( major, minor ) 0 +#endif /* This macro can be used to check that the version of mingw32 compiler is