- // int Printf(const wxChar *pszFormat, ...);
- WX_DEFINE_VARARG_FUNC(int, Printf, DoPrintf)
- // static wxString Format(const wxChar *pszFormat, ...) ATTRIBUTE_PRINTF_1;
- WX_DEFINE_VARARG_FUNC(static typename StringReturnType<T1>::type,
- Format, DoFormat)
- // int sprintf(const wxChar *pszFormat, ...) ATTRIBUTE_PRINTF_2;
- WX_DEFINE_VARARG_FUNC(int, sprintf, DoPrintf)
+ // static wxString Format(const wString& format, ...) ATTRIBUTE_PRINTF_1;
+ WX_DEFINE_VARARG_FUNC2_SANS_N0(static typename StringReturnType<T1>::type,
+ Format, 1, (const wxString&),
+ DoFormat, DoFormat)
+ // We have to implement the version without template arguments manually
+ // because of the StringReturnType<> hack, although WX_DEFINE_VARARG_FUNC
+ // normally does it itself. It has to be a template so that we can use
+ // the hack, even though there's no real template parameter:
+ struct FormatDummyArg {} ;
+
+ template<typename T>
+ inline static typename StringReturnType<T>::type
+ Format(const wxString& fmt, FormatDummyArg dummy = FormatDummyArg())
+ {
+ return DoFormat(fmt);
+ }
+
+ // int Printf(const wxString& format, ...);
+ WX_DEFINE_VARARG_FUNC(int, Printf, 1, (const wxString&), DoPrintf)
+ // int sprintf(const wxString& format, ...) ATTRIBUTE_PRINTF_2;
+ WX_DEFINE_VARARG_FUNC(int, sprintf, 1, (const wxString&), DoPrintf)