wxS(): replacement of wxT/_T in the common code
Vadim Zeitlin
vadim at wxwidgets.org
Wed Jan 2 08:35:26 PST 2008
Hello,
I've added wxS() macro as previously discussed (both to the trunk and, for
people who wish to support both 2.8 and 3.0 starting from now, to 2.8
branch). wxT and _T stay unchanged.
This new wxS macro expands into a wide string (or character) in wchar_t-
based Unicode builds and leaves its argument unchanged otherwise. So it
should be used in common code instead of wxT/_T as the latter result in
unnecessary run-time conversions in UTF-8 builds (and removing them
completely would result in unnecessary conversions in Windows builds). I
don't think I'm going to change all the existing occurrences of wxT/_T any
time soon but if anybody is willing to do it, it would be nice -- not so
much for (tiny) performance improvements but just to make the code more
clear. But it does make sense to use wxS() in the new code or, rather, not
use wxT/_T any more as using no macros at all is fine too if the code is
not at all performance-sensitive.
Please let me know if you have any questions/problems, thanks,
VZ
More information about the wx-dev
mailing list