fixed vararg functions with format argument to not use wxString or reference argument (the latter is invalid C++, the former doesn't work with Watcom and produces at least warnings with GCC 3.3)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-05-03 10:50:25 +00:00
parent 30957174e5
commit d1f6e2cfe2
14 changed files with 543 additions and 143 deletions

View File

@@ -37,18 +37,27 @@ public:
// show a message to the user
// void Printf(const wxString& format, ...) = 0;
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const wxString&), DoPrintf)
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const wxString&),
DoPrintfWchar, DoPrintfUtf8)
#ifdef __WATCOMC__
// workaround for http://bugzilla.openwatcom.org/show_bug.cgi?id=351
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const char*), DoPrintf)
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const wchar_t*), DoPrintf)
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const wxCStrData&), DoPrintf)
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const char*),
DoPrintfWchar, DoPrintfUtf8)
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const wchar_t*),
DoPrintfWchar, DoPrintfUtf8)
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const wxCStrData&),
DoPrintfWchar, DoPrintfUtf8)
#endif
protected:
// NB: this is pure virtual so that it can be implemented in dllexported
// wxMessagOutput class
virtual void DoPrintf(const wxString& format, ...) = 0;
#if !wxUSE_UTF8_LOCALE_ONLY
virtual void DoPrintfWchar(const wxChar *format, ...) = 0;
#endif
#if wxUSE_UNICODE_UTF8
virtual void DoPrintfUtf8(const char *format, ...) = 0;
#endif
// called by DoPrintf() to output formatted string
virtual void Output(const wxString& str) = 0;
@@ -73,7 +82,12 @@ public:
static wxMessageOutput* Set(wxMessageOutput* msgout);
protected:
virtual void DoPrintf(const wxString& format, ...);
#if !wxUSE_UTF8_LOCALE_ONLY
virtual void DoPrintfWchar(const wxChar *format, ...);
#endif
#if wxUSE_UNICODE_UTF8
virtual void DoPrintfUtf8(const char *format, ...);
#endif
virtual void Output(const wxString& str) = 0;
private: