Implemented the various printf() functions under

Unicode with their GNU libc 2.2 funtions. This
    saves us some unicode<->ansi conversion and we
    no longer need the experimental printf() code
    in string.cpp. I had to implement wxSprintf()
    using wxSnprintf() as the former doesn't exist
    in Unicode GNU libc 2.2.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2002-08-10 11:58:15 +00:00
parent e6ccaf1a99
commit a59c124d06
4 changed files with 84 additions and 100 deletions

View File

@@ -165,16 +165,32 @@ inline int Stricmp(const char *psz1, const char *psz2)
#endif // OS/compiler
}
#ifndef wxSnprintf
// wxSnprintf() is like snprintf() if it's available and sprintf() (always
// available, but dangerous!) if not
// available, but dangerous!) if not.
extern int WXDLLEXPORT wxSnprintf(wxChar *buf, size_t len,
const wxChar *format,
...) ATTRIBUTE_PRINTF_3;
#else
// GNU libc 2.2 only has for wxSnprintf for Unicode called swprintf
// so we imitate wxSprintf using it.
extern int WXDLLEXPORT wxSprintf(wxChar *buf,
const wxChar *format,
...) ATTRIBUTE_PRINTF_2;
#endif
#ifndef wxVsnprintf
// and wxVsnprintf() is like vsnprintf() or vsprintf()
extern int WXDLLEXPORT wxVsnprintf(wxChar *buf, size_t len,
const wxChar *format,
va_list argptr);
#else
// GNU libc 2.2 only has for wxVsnprintf for Unicode called vswprintf
// so we imitate wxVsprintf using it.
extern int WXDLLEXPORT wxVsprintf(wxChar *buf,
const wxChar *format,
va_list argptr);
#endif
// return an empty wxString
class WXDLLEXPORT wxString; // not yet defined