Undef _T before including standard headers and redefine it later.

This change fixes the build of wxWidgets itself by undefining _T() before
including any standard headers and redefining it after including them.

See #10660.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@61871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-09-09 22:29:51 +00:00
parent 7620326bdb
commit 9ff9127930
2 changed files with 33 additions and 0 deletions

View File

@@ -46,3 +46,26 @@
#endif
#endif
/*
Redefine _T if we undefined it in wx/beforestd.h (see comment there about
why do we do it) and if we need it (we always do when building wx itself
and might also need when compiling the user code but this must be indicated
by the special wxNEEDS__T macro)
*/
#if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
#if defined(WXBUILDING) || defined(wxNEEDS_T)
/*
Undefine _T in case it was defined in the standard header.
*/
#undef _T
/*
And define it again in the same way as it's done in wx/wxchar.h.
*/
#if wxUSE_UNICODE
#define _T(x) wxCONCAT_HELPER(L, x)
#else /* !Unicode */
#define _T(x) x
#endif /* Unicode/!Unicode */
#endif /* we need _T() to be defined */
#endif /* defined(__SUNPRO_CC) || defined(__SUNPRO_C) */

View File

@@ -63,3 +63,13 @@
#pragma warning(disable:4786)
#endif // VC++ < 7
/*
Recent versions of Sun C++ compiler use _T in their standard headers and
our definition of it in wx/wxchar.h conflicts with them and breaks
compilation, so undefine _T before including them and redefine it back in
wx/afterstd.h if needed.
*/
#if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
#undef _T
#endif /* SUNCC */