]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wxchar.cpp
wxCocoa: Added gauge.(mm|h)
[wxWidgets.git] / src / common / wxchar.cpp
index 6b2a005483c7cd0af6cc137d6627d79212cf19b1..326c34dbe61aca75fb7d8d6046900bd0331623bf 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <locale.h>
+
+#ifndef __WXWINCE__
 #include <time.h>
+#include <locale.h>
+#else
+#include "wx/msw/wince/time.h"
+#endif
 
 #ifndef WX_PRECOMP
   #include "wx/defs.h"
@@ -1255,7 +1260,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
 
@@ -1382,7 +1396,10 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt
 #if __MSL__ < 0x00008000
 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
 int isascii( int c )
@@ -1391,3 +1408,31 @@ int isascii( int c )
 }
 #endif // __MWERKS__
 
+#ifdef __WXWINCE__
+char* strdup(const char* s)
+{
+    char *dest = (char*) malloc( strlen( s ) + 1 ) ;
+    if ( dest )
+        strcpy( dest , s ) ;
+    return dest ;
+}
+
+void *calloc( size_t num, size_t size )
+{
+    void** ptr = (void **)malloc(num * size);
+    memset( ptr, 0, num * size);
+    return ptr;
+}
+
+int isspace(int c)
+{
+    return (c == ' ');
+}
+
+int isascii( int c )
+{
+        return ( c >= 0 && c < 128 ) ;
+}
+#endif
+
+