Globally replace _T() with wxT().

Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-23 20:30:22 +00:00
parent 32cdc45397
commit 9a83f86094
798 changed files with 10370 additions and 10349 deletions

View File

@@ -222,7 +222,7 @@
/* ------------------------------------------------------------------------- */
/* define _T() and related macros */
/* define wxT() and related macros */
/* ------------------------------------------------------------------------- */
/* BSD systems define _T() to be something different in ctype.h, override it */
@@ -231,15 +231,19 @@
#undef _T
#endif
/* could already be defined by tchar.h (it's quasi standard) */
#ifndef _T
/*
wxT ("wx text") macro turns a literal string constant into a wide char
constant. It is mostly unnecessary with wx 2.9 but defined for
compatibility.
*/
#ifndef wxT
#if !wxUSE_UNICODE
#define _T(x) x
#define wxT(x) x
#else /* Unicode */
/* use wxCONCAT_HELPER so that x could be expanded if it's a macro */
#define _T(x) wxCONCAT_HELPER(L, x)
#define wxT(x) wxCONCAT_HELPER(L, x)
#endif /* ASCII/Unicode */
#endif /* !defined(_T) */
#endif /* !defined(wxT) */
/*
wxS ("wx string") macro can be used to create literals using the same
@@ -253,13 +257,25 @@
#define wxS(x) x
#endif
/* although global macros with such names are normally bad, we want to have */
/* another name for _T() which should be used to avoid confusion between */
/* _T() and _() in wxWidgets sources */
#define wxT(x) _T(x)
/*
_T() is a synonym for wxT() familiar to Windows programmers. As this macro
has even higher risk of conflicting with system headers, its use is
discouraged and you may predefine wxNO__T to disable it. Additionally, we
do it ourselves for Sun CC which is known to use it in its standard headers
(see #10660).
*/
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#ifndef wxNO__T
#define wxNO__T
#endif
#endif
#if !defined(_T) && !defined(wxNO__T)
#define _T(x) wxT(x)
#endif
/* a helper macro allowing to make another macro Unicode-friendly, see below */
#define wxAPPLY_T(x) _T(x)
#define wxAPPLY_T(x) wxT(x)
/* Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs */
#ifndef __TFILE__