+}
+
+#ifdef wxCRT_PerrorA
+
+void wxPerror(const wxString& s)
+{
+#ifdef wxCRT_PerrorW
+ CALL_ANSI_OR_UNICODE(wxEMPTY_PARAMETER_VALUE,
+ wxCRT_PerrorA(s.mb_str()),
+ wxCRT_PerrorW(s.wc_str()));
+#else
+ wxCRT_PerrorA(s.mb_str());
+#endif
+}
+
+#endif // wxCRT_PerrorA
+
+wchar_t *wxFgets(wchar_t *s, int size, FILE *stream)
+{
+ wxCHECK_MSG( s, NULL, "empty buffer passed to wxFgets()" );
+
+ wxCharBuffer buf(size - 1);
+ // FIXME: this reads too little data if wxConvLibc uses UTF-8 ('size' wide
+ // characters may be encoded by up to 'size'*4 bytes), but what
+ // else can we do?
+ if ( wxFgets(buf.data(), size, stream) == NULL )
+ return NULL;
+
+ if ( wxConvLibc.ToWChar(s, size, buf, wxNO_LEN) == wxCONV_FAILED )
+ return NULL;
+
+ return s;
+}
+
+// ----------------------------------------------------------------------------
+// wxScanf() and friends
+// ----------------------------------------------------------------------------
+
+#ifdef HAVE_VSSCANF // __VISUALC__ and __DMC__ see wx/crt.h
+int wxVsscanf(const char *str, const char *format, va_list ap)
+ { return wxCRT_VsscanfA(str, format, ap); }
+int wxVsscanf(const wchar_t *str, const wchar_t *format, va_list ap)
+ { return wxCRT_VsscanfW(str, format, ap); }
+int wxVsscanf(const wxCharBuffer& str, const char *format, va_list ap)
+ { return wxCRT_VsscanfA(static_cast<const char*>(str), format, ap); }
+int wxVsscanf(const wxWCharBuffer& str, const wchar_t *format, va_list ap)
+ { return wxCRT_VsscanfW(str, format, ap); }
+int wxVsscanf(const wxString& str, const char *format, va_list ap)
+ { return wxCRT_VsscanfA(static_cast<const char*>(str.mb_str()), format, ap); }
+int wxVsscanf(const wxString& str, const wchar_t *format, va_list ap)
+ { return wxCRT_VsscanfW(str.wc_str(), format, ap); }
+int wxVsscanf(const wxCStrData& str, const char *format, va_list ap)
+ { return wxCRT_VsscanfA(static_cast<const char*>(str.AsCharBuf()), format, ap); }
+int wxVsscanf(const wxCStrData& str, const wchar_t *format, va_list ap)
+ { return wxCRT_VsscanfW(str.AsWCharBuf(), format, ap); }
+#endif // HAVE_NO_VSSCANF