X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c193821a999730fbf6a9bea83763f37daae68f1..05e1201cb5943fb9c75f5612e9fb9323358edab5:/src/common/wxchar.cpp?ds=inline diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 571d165d3d..11233ff4fd 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "wxchar.h" #endif @@ -1205,28 +1205,6 @@ 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) { @@ -1260,7 +1238,16 @@ WXDLLEXPORT int wxRename(const wxChar *oldpath, const wxChar *newpath) #ifndef wxAtof double WXDLLEXPORT wxAtof(const wxChar *psz) { - return atof(wxConvLocal.cWX2MB(psz)); +#ifdef __WXWINCE__ + double d; + wxString str(psz); + if (str.ToDouble(& d)) + return d; + else + return 0.0; +#else + return atof(wxConvLocal.cWX2MB(psz)); +#endif } #endif @@ -1296,7 +1283,7 @@ wxChar * WXDLLEXPORT wxGetenv(const wxChar *name) // printf( "home %s\n", val ); // convert it, -#ifdef wxUSE_UNICODE +#if wxUSE_UNICODE data = (wxObject *)new wxString(val, wxConvLocal); #else data = (wxObject *)new wxString(val); @@ -1383,16 +1370,38 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt // missing C RTL functions // ---------------------------------------------------------------------------- -#if defined( __MWERKS__ ) && !defined(__MACH__) -#if __MSL__ < 0x00008000 +#if (defined(__MWERKS__) && !defined(__MACH__) && (__MSL__ < 0x00008000)) || \ + defined(__WXWINCE__) char *strdup(const char *s) { - return strcpy( (char*) malloc( strlen( s ) + 1 ) , s ) ; + char *dest = (char*) malloc( strlen( s ) + 1 ) ; + if ( dest ) + strcpy( dest , s ) ; + return dest ; } #endif + +#if (defined(__MWERKS__) && !defined(__MACH__)) || (defined(__WXWINCE__) && _WIN32_WCE <= 211) + int isascii( int c ) { - return ( c >= 0 && c < 128 ) ; + return ( c >= 0 && c < 128 ); +} +#endif + +#if defined(__WXWINCE__) +void *calloc( size_t num, size_t size ) +{ + void** ptr = (void **)malloc(num * size); + memset( ptr, 0, num * size); + return ptr; +} + +#if (_WIN32_WCE <= 211) +int isspace(int c) +{ + return (c == ' '); } -#endif // __MWERKS__ +#endif +#endif