X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/28efe6544f28ba7b37a77c033901fdd6f3978b82..13d4419b86d028b3e7e32b0f94cc45c40dd9551c:/include/wx/chartype.h diff --git a/include/wx/chartype.h b/include/wx/chartype.h index a326f0691c..64f7147cbb 100644 --- a/include/wx/chartype.h +++ b/include/wx/chartype.h @@ -214,11 +214,9 @@ #endif /* define char type used by wxString internal representation: */ -#if wxUSE_UNICODE_UTF8 - typedef char wxStringCharType; -#elif wxUSE_UNICODE_WCHAR +#if wxUSE_UNICODE_WCHAR typedef wchar_t wxStringCharType; -#else +#else /* wxUSE_UNICODE_UTF8 || ANSI */ typedef char wxStringCharType; #endif @@ -243,6 +241,18 @@ #endif /* ASCII/Unicode */ #endif /* !defined(_T) */ +/* + wxS ("wx string") macro can be used to create literals using the same + representation as wxString does internally, i.e. wchar_t in Unicode build + under Windows or char in UTF-8-based Unicode builds and (deprecated) ANSI + builds everywhere (see wxStringCharType definition above). + */ +#if wxUSE_UNICODE_WCHAR + #define wxS(x) wxCONCAT_HELPER(L, x) +#else /* wxUSE_UNICODE_UTF8 || ANSI */ + #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 */