Add wxT_2() macro for compatibility with wxWidgets 2 API.

This macro can be used to make the same code compile with both v2 and v3 as it
expands to wxT() in 2.8 and nothing in later versions.

See #12925.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66968 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-02-19 13:44:19 +00:00
parent 1244d2e07f
commit 9204fde6ee
3 changed files with 35 additions and 1 deletions

View File

@@ -32,6 +32,32 @@
*/
#define wxT(string)
/**
Compatibility macro which expands to wxT() in wxWidgets 2 only.
This macro can be used in the code which needs to compile with both
wxWidgets 2 and 3 versions in places where v2 API requires a Unicode string
(in Unicode build) and v3 API only accepts a standard standard narrow
string as in e.g. wxCmdLineEntryDesc structure objects initializers.
Example of use:
@code
const wxCmdLineEntryDesc cmdLineDesc[] =
{
{ wxCMD_LINE_SWITCH, wxT_2("q"), wxT_2("quiet"),
wxT_2("Don't output verbose messages") },
wxCMD_LINE_DESC_END
};
@endcode
Without @c wxT_2 the code above wouldn't compile with wxWidgets 2, with @c
wxT instead of it, it wouldn't compile with wxWidgets 3.
@see wxT()
@header{wx/chartype.h}
*/
/**
wxS is macro which can be used with character and string literals (in other words,
@c 'x' or @c "foo") to either convert them to wide characters or wide strings