- {
- size_t size = (wxStrlen(psz) + 1) * sizeof(wxChar);
- wxChar *ret = (wxChar *) malloc(size);
- memcpy(ret, psz, size);
- return ret;
- }
+#define wxMB2WX wxStrncpy
+#define wxWX2MB wxStrncpy
+#define wxWC2WX wxWC2MB
+#define wxWX2WC wxMB2WC
+#endif
+
+// if libc versions are not available, use replacements defined in wxchar.cpp
+#ifndef wxStrdup
+wxChar * WXDLLEXPORT wxStrdup(const wxChar *psz);
+#endif
+
+#ifndef wxStrtok
+wxChar * WXDLLEXPORT wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_ptr);
+#endif
+
+#ifndef wxSetlocale
+wxChar * WXDLLEXPORT wxSetlocale(int category, const wxChar *locale);
+#endif
+
+#ifdef wxNEED_WX_STDIO_H
+#include <stdarg.h>
+int WXDLLEXPORT wxSprintf(wxChar *buf, const wxChar *fmt, ...);
+int WXDLLEXPORT wxVsprintf(wxChar *buf, const wxChar *fmt, va_list argptr);
+#endif
+
+#ifdef wxNEED_WX_STDLIB_H
+double WXDLLEXPORT wxAtof(const wxChar *psz);
+int WXDLLEXPORT wxAtoi(const wxChar *psz);
+long WXDLLEXPORT wxAtol(const wxChar *psz);
+wxChar * WXDLLEXPORT wxGetenv(const wxChar *name);
+int WXDLLEXPORT wxSystem(const wxChar *psz);