X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/44c44c82a3fe5362bac5cc9536f06eeac52af00c..6992d326eb1246d9d03f04245d0cd87eab65f6f7:/src/common/wxchar.cpp diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index afff852e81..6b2a005483 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -47,6 +47,14 @@ #include #endif +#if defined(__MWERKS__) && __MSL__ >= 0x6000 +using namespace std ; +#endif + +#ifdef __WXMAC__ + #include "wx/mac/private.h" +#endif + #if wxUSE_WCHAR_T size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n) { @@ -848,11 +856,7 @@ int wxFscanf( FILE *stream, const wxChar *format, ... ) { va_list argptr; va_start(argptr, format); -#ifdef __WXMAC__ - int ret = ::vfwscanf(stream, wxFormatConverter(format), argptr); -#else int ret = vfwscanf(stream, wxFormatConverter(format), argptr); -#endif va_end(argptr); @@ -1005,7 +1009,8 @@ int WXDLLEXPORT wxStricmp(const wxChar *psz1, const wxChar *psz2) #ifndef wxStricmp int WXDLLEXPORT wxStrnicmp(const wxChar *s1, const wxChar *s2, size_t n) { - register wxChar c1, c2; + // initialize the variables just to suppress stupid gcc warning + register wxChar c1 = 0, c2 = 0; while (n && ((c1 = wxTolower(*s1)) == (c2 = wxTolower(*s2)) ) && c1) n--, s1++, s2++; if (n) { if (c1 < c2) return -1; @@ -1195,6 +1200,28 @@ WXDLLEXPORT long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base) } #endif // wxNEED_WX_STRING_H +#if defined(__WXMAC__) && !defined(__DARWIN__) +WXDLLEXPORT FILE * wxFopen(const wxChar *path, const wxChar *mode) +{ + return fopen( wxMacStringToCString(path), mode ); +} + +WXDLLEXPORT FILE * wxFreopen(const wxChar *path, const wxChar *mode, FILE *stream) +{ + return freopen( wxMacStringToCString(path), mode, stream ); +} + +WXDLLEXPORT int wxRemove(const wxChar *path) +{ + return remove( wxMacStringToCString(path) ); +} + +WXDLLEXPORT int wxRename(const wxChar *oldpath, const wxChar *newpath) +{ + return rename( wxMacStringToCString(oldpath), wxMacStringToCString(newpath) ); +} +#endif + #ifdef wxNEED_WX_STDIO_H WXDLLEXPORT FILE * wxFopen(const wxChar *path, const wxChar *mode) { @@ -1347,3 +1374,20 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt #endif // wxStrtok +// ---------------------------------------------------------------------------- +// missing C RTL functions +// ---------------------------------------------------------------------------- + +#if defined( __MWERKS__ ) && !defined(__MACH__) +#if __MSL__ < 0x00008000 +char *strdup(const char *s) +{ + return strcpy( (char*) malloc( strlen( s ) + 1 ) , s ) ; +} +#endif +int isascii( int c ) +{ + return ( c >= 0 && c < 128 ) ; +} +#endif // __MWERKS__ +