From f778d781eb82a9f6ffdb240cc2ad147831e3ff3c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 27 Aug 2002 09:02:12 +0000 Subject: [PATCH] fixed wxVsnprintf_() compilation in ASCII mode git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wxchar.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 7f532e5b36..19284b8813 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -163,13 +163,7 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, buf[lenCur++] = ch #define APPEND_STR(s) \ - for ( const char *p = s; *p; p++ ) \ - { \ - APPEND_CH((wchar_t)(*p)); \ - } - -#define APPEND_WSTR(s) \ - for ( const wchar_t *p = s; *p; p++ ) \ + for ( const wxChar *p = s; *p; p++ ) \ { \ APPEND_CH(*p); \ } @@ -305,7 +299,7 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, ::sprintf(szScratch, s_szFlags, val); } - APPEND_STR(szScratch); + APPEND_STR(wxConvLibc.cMB2WX(szScratch)); done = TRUE; break; @@ -326,7 +320,7 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, ::sprintf(szScratch, s_szFlags, val); } - APPEND_STR(szScratch); + APPEND_STR(wxConvLibc.cMB2WX(szScratch)); done = TRUE; break; @@ -339,7 +333,7 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, s_szFlags[flagofs] = '\0'; ::sprintf(szScratch, s_szFlags, val); - APPEND_STR(szScratch); + APPEND_STR(wxConvLibc.cMB2WX(szScratch)); done = TRUE; } @@ -372,7 +366,7 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, if (s.Len() < min_width) s.Pad(min_width - s.Len(), wxT(' '), adj_left); - APPEND_WSTR(s); + APPEND_STR(s); } else { wxChar *val = va_arg(argptr, wxChar *); size_t len = wxSTRING_MAXLEN; @@ -383,7 +377,7 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, if (s.Len() < min_width) s.Pad(min_width - s.Len(), wxT(' '), adj_left); - APPEND_WSTR(s); + APPEND_STR(s); } done = TRUE; break;