#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
// identical to c_str()
const wxChar* GetData() const { return m_pchData; }
+ // conversion to plain ascii: this is usefull for
+ // converting numbers or strings which are certain
+ // not to contain special chars (typically system
+ // functions, X atoms, environment variables etc.)
+#if wxUSE_UNICODE
+ static wxString FromAscii( char *ascii );
+ const wxCharBuffer ToAscii() const;
+#else
+ static wxString FromAscii( char *ascii ) { return wxString( ascii ); }
+ const char *ToAscii() const { return m_pchData; }
+#endif
+
// conversions with (possible) format convertions: have to return a
// buffer with temporary data
//