X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c9f7896861f734ce044ee8601ba2d8a6959c9d9e..1be2473f5909d77ec93070d390429d92f3e47298:/include/wx/strvararg.h?ds=inline diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index fd7301603a..6ad650be85 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -16,13 +16,7 @@ #error "OpenWatcom version >= 1.4 is required to compile this code" #endif -// include wchar_t definition if needed: -#if defined(__WATCOMC__) -#include -#elif defined(__VISUALC__) -#include -#endif - +#include "wx/chartype.h" class WXDLLIMPEXP_BASE wxCStrData; class WXDLLIMPEXP_BASE wxString; @@ -95,27 +89,11 @@ struct wxArgNormalizer // special cases for converting strings: -// FIXME-UTF8: move this to wxchartype.h! -#if wxUSE_UNICODE - /* for now, all Unicode builds are wchar_t* based: */ - #define wxUSE_UNICODE_WCHAR 1 -#else - #define wxUSE_UNICODE_WCHAR 0 -#endif - -// FIXME-UTF8: include wx/wxchartype.h and use wxChar after headers split -// FIXME-UTF8: this will be char* in UTF-8 build and wchar_t* on Windows -#if wxUSE_UNICODE_WCHAR - typedef wchar_t wxArgNativeCharType; -#else - typedef char wxArgNativeCharType; -#endif - template<> struct WXDLLIMPEXP_BASE wxArgNormalizer { wxArgNormalizer(const wxCStrData& value) : m_value(value) {} - const wxArgNativeCharType *get() const; + const wxStringCharType *get() const; const wxCStrData& m_value; }; @@ -131,7 +109,7 @@ template<> struct WXDLLIMPEXP_BASE wxArgNormalizer { wxArgNormalizer(const wxString& value) : m_value(value) {} - const wxArgNativeCharType *get() const; + const wxStringCharType *get() const; const wxString& m_value; }; @@ -183,6 +161,23 @@ struct wxArgNormalizer : public wxArgNormalizer #endif // wxUSE_UNICODE_WCHAR / !wxUSE_UNICODE_WCHAR && wxUSE_WCHAR_T +// versions for passing wx[W]CharBuffer: +template<> +struct WXDLLIMPEXP_BASE wxArgNormalizer + : public wxArgNormalizer +{ + wxArgNormalizer(const wxCharBuffer& buf); +}; + +template<> +struct WXDLLIMPEXP_BASE wxArgNormalizer + : public wxArgNormalizer +{ + wxArgNormalizer(const wxWCharBuffer& buf); +}; + + + // NB: The vararg emulation code is limited to 30 arguments at the moment. // If you need more, you need to // 1) increase the value of _WX_VARARG_MAX_ARGS