X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50e27899137071a7379e0bcca3ced4097d982e5b..e6310bbc5a3bce1033c0e579341e115be9df6fe9:/src/common/wxcrt.cpp diff --git a/src/common/wxcrt.cpp b/src/common/wxcrt.cpp index 27285316f9..2b862a043a 100644 --- a/src/common/wxcrt.cpp +++ b/src/common/wxcrt.cpp @@ -548,8 +548,11 @@ int wxDoSnprintfUtf8(wchar_t *str, size_t size, const char *format, ...) #if wxUSE_UNICODE +namespace +{ + #if !wxUSE_UTF8_LOCALE_ONLY -static int ConvertStringToBuf(const wxString& s, char *out, size_t outsize) +int wxInternalConvertStringToBuf(const wxString& s, char *out, size_t outsize) { const wxWX2WCbuf buf = s.wc_str(); @@ -562,7 +565,7 @@ static int ConvertStringToBuf(const wxString& s, char *out, size_t outsize) #endif // !wxUSE_UTF8_LOCALE_ONLY #if wxUSE_UNICODE_UTF8 -static int ConvertStringToBuf(const wxString& s, wchar_t *out, size_t outsize) +int wxInternalConvertStringToBuf(const wxString& s, wchar_t *out, size_t outsize) { const wxWX2WCbuf buf(s.wc_str()); size_t len = wxWcslen(buf); @@ -573,6 +576,8 @@ static int ConvertStringToBuf(const wxString& s, wchar_t *out, size_t outsize) } #endif // wxUSE_UNICODE_UTF8 +} // anonymous namespace + template static size_t PrintfViaString(T *out, size_t outsize, const wxString& format, va_list argptr) @@ -580,18 +585,18 @@ static size_t PrintfViaString(T *out, size_t outsize, wxString s; s.PrintfV(format, argptr); - return ConvertStringToBuf(s, out, outsize); + return wxInternalConvertStringToBuf(s, out, outsize); } #endif // wxUSE_UNICODE int wxVsprintf(char *str, const wxString& format, va_list argptr) { #if wxUSE_UTF8_LOCALE_ONLY - return vsprintf(str, format.wx_str(), argptr); + return wxCRT_VsprintfA(str, format.wx_str(), argptr); #else #if wxUSE_UNICODE_UTF8 if ( wxLocaleIsUtf8 ) - return vsprintf(str, format.wx_str(), argptr); + return wxCRT_VsprintfA(str, format.wx_str(), argptr); else #endif #if wxUSE_UNICODE @@ -861,6 +866,7 @@ wxCRT_StrftimeW(wchar_t *s, size_t maxsize, const wchar_t *fmt, const struct tm #endif // wxUSE_WCHAR_T +#ifdef wxLongLong_t template static wxULongLong_t wxCRT_StrtoullBase(const T* nptr, T** endptr, int base, T* sign) @@ -1014,6 +1020,8 @@ wxULongLong_t wxCRT_StrtoullW(const wchar_t* nptr, wchar_t** endptr, int base) { return wxCRT_DoStrtoull(nptr, endptr, base); } #endif +#endif // wxLongLong_t + // ---------------------------------------------------------------------------- // functions which we may need even if !wxUSE_WCHAR_T // ----------------------------------------------------------------------------