From: Václav Slavík Date: Sat, 2 Jun 2007 12:45:19 +0000 (+0000) Subject: partially fixed passing wxUniChar as vararg argument (non-ASCII characters are still... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/24d68c95ad23c20800677539329d04b9b3b8c4ce partially fixed passing wxUniChar as vararg argument (non-ASCII characters are still broken in UTF8 build, other cases work) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index c1aa0364f6..7c7ae7ae82 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -18,9 +18,9 @@ #include "wx/cpp.h" #include "wx/chartype.h" -#include "wx/wxcrt.h" #include "wx/strconv.h" #include "wx/buffer.h" +#include "wx/unichar.h" class WXDLLIMPEXP_BASE wxCStrData; class WXDLLIMPEXP_BASE wxString; @@ -419,6 +419,35 @@ WX_ARG_NORMALIZER_FORWARD(wxStdWideString, const wxStdWideString&); #endif // wxUSE_STD_STRING +// versions for wxUniChar, wxUniCharRef: + +#if !wxUSE_UTF8_LOCALE_ONLY +template<> +struct wxArgNormalizerWchar + : public wxArgNormalizerWchar +{ + wxArgNormalizerWchar(const wxUniChar& s) + : wxArgNormalizerWchar((wxChar)s) {} +}; +#endif // !wxUSE_UTF8_LOCALE_ONLY + +#if wxUSE_UNICODE_UTF8 +template<> +struct wxArgNormalizerUtf8 + : public wxArgNormalizerUtf8 +{ + wxArgNormalizerUtf8(const wxUniChar& s) + // FIXME-UTF8: this is lossy, we need to convert to string, but that + // requires format string update + : wxArgNormalizerUtf8((const char)s) {} +}; +#endif // wxUSE_UNICODE_UTF8 + +WX_ARG_NORMALIZER_FORWARD(wxUniChar, const wxUniChar&); +WX_ARG_NORMALIZER_FORWARD(const wxUniCharRef&, const wxUniChar&); +WX_ARG_NORMALIZER_FORWARD(wxUniCharRef, const wxUniChar&); + + #undef WX_ARG_NORMALIZER_FORWARD #undef _WX_ARG_NORMALIZER_FORWARD_IMPL