make our vsnprintf() implementation work for ANSI version too

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-06-18 16:14:25 +00:00
parent 300b44a933
commit dd25c6ee10
2 changed files with 120 additions and 127 deletions

View File

@@ -560,25 +560,6 @@ int wxCRT_VsnprintfW(wchar_t *str, size_t size, const wchar_t *format, va_list a
}
#endif // !wxCRT_VsnprintfW
// FIXME-UTF8: we only implement widechar version of vsnprintf() in wxprint.cpp,
// so this one has to convert the data for now
#ifndef wxCRT_VsnprintfA
int wxCRT_VsnprintfA(char *buf, size_t len, const char *format, va_list argptr)
{
wxWCharBuffer wbuf(len);
int rt = wxCRT_VsnprintfW(wbuf.data(), len,
(const wchar_t*)wxConvLibc.cMB2WC(format),
argptr);
if ( rt < 0 || rt >= (int)len )
return rt;
if ( wxConvLibc.FromWChar(buf, len, wbuf) == wxCONV_FAILED )
return -1;
return rt;
}
#endif // !wxCRT_VsnprintfA
#ifndef wxCRT_VsprintfW
int wxCRT_VsprintfW( wchar_t *str, const wchar_t *format, va_list argptr )
{