From da7a3bcfd2ab267ddc5e1a1e9af6c5da491e722f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Feb 2011 13:54:14 +0000 Subject: [PATCH] Define forward-compatible wxT_2() macro. This macro is the same as wxT() in wx 2.8 but allows to write code compatible with wxWidgets 3 where it expands to nothing. See #12925 and r66968. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@66970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 3 +++ include/wx/wxchar.h | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 7bb64bedf0..840d858e42 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -96,6 +96,9 @@ All: - Fixed a bug in UNC path testing. - Improved command line parser usage help. - Fixed race condition bugs in wxCondition. +- Added wxT_2() for forward compatibility with wxWidgets 3. Use it in + initialization of wxCmdLineEntryDesc struct elements and (very few) other + places where wxT() is required currently but won't be allowed in v3. All (GUI): diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index a1f71fd70b..1332b562c0 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -237,6 +237,14 @@ #define wxT(x) x #endif /* Unicode/!Unicode */ +/* + This macro is defined for forward compatibility with wxWidgets 3. It should + be used in the places where wxWidgets 2 API requires wxT() (in Unicode + build) but wxWidgets 3 doesn't accept it, e.g. wxCmdLineEntryDesc struct + elements initializers. + */ +#define wxT_2(x) wxT(x) + /* We define _T() as a synonym of wxT() for backwards compatibility and also for the benefit of Windows programmers used to it. But this identifier is a