]> git.saurik.com Git - wxWidgets.git/commitdiff
Added RTL functions missing from WinCE to wxchar.h/cpp
authorJulian Smart <julian@anthemion.co.uk>
Tue, 15 Jul 2003 13:46:39 +0000 (13:46 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 15 Jul 2003 13:46:39 +0000 (13:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/hashmap.h
include/wx/wxchar.h
src/common/string.cpp
src/common/valtext.cpp
src/common/wxchar.cpp
src/common/xpmdecod.cpp

index 23e685dd2d9484978ccf0b994b3983f6e22a8d81..896cd12db0b54f63edf1572bd100532c381101c4 100644 (file)
@@ -74,13 +74,7 @@ protected:
 
     static void** AllocTable( size_t sz )
     {
-#ifdef __WXWINCE__
-        void** ptr = (void **)malloc(sz * sizeof(void*));
-        memset( ptr, 0, sz * sizeof(void*));
-        return ptr;
-#else
         return (void **)calloc(sz, sizeof(void*));
-#endif
     }
 };
 
index 5cac45dfc9b96b79aa374d0399fd99dc7efe59dc..9a30e286fae62db60165731fb6e01e19050d8bf0 100644 (file)
@@ -927,6 +927,14 @@ WXDLLIMPEXP_BASE int      wxSystem(const wxChar *psz);
                                   const wxChar *fmt, const struct tm *tm);
 #endif // wxNEED_WX_TIME_H
 
+// missing functions in WinCE
+#ifdef __WXWINCE__
+WXDLLIMPEXP_BASE char* strdup(const char* s);
+WXDLLIMPEXP_BASE void *calloc( size_t num, size_t size );
+WXDLLIMPEXP_BASE int isspace(int c);
+WXDLLIMPEXP_BASE int isascii( int c );
+#endif
+
 // ----------------------------------------------------------------------------
 // multibyte to wide char conversion functions and macros
 // ----------------------------------------------------------------------------
index 964324306b8c1817a44282e8df5ac4716eb3b7b2..c43bde8e7d3271f93efc7c7e4d2fecdc1d62b5df 100644 (file)
@@ -1013,10 +1013,6 @@ wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplaceAll)
   return uiCount;
 }
 
-#ifdef __WXWINCE__
-inline int isascii(wxChar c) { return (c >= 0) && (c <=127); }
-#endif
-
 bool wxString::IsAscii() const
 {
   const wxChar *s = (const wxChar*) *this;
index 0b8f2b0eccb60fbe2c31dd4eb49fb6d33cbfb2ee..2c2b1f0094b8dc88090387f3f3e66acad412127b 100644 (file)
@@ -229,10 +229,6 @@ void wxTextValidator::SetExcludeList(const wxStringList& list)
     m_excludeList = list;
 }
 
-#ifdef __WXWINCE__
-inline int isascii(wxChar c) { return (c >= 0) && (c <=127); }
-#endif
-
 void wxTextValidator::OnChar(wxKeyEvent& event)
 {
 /*
index 02ca10af2f37b128f870e4a88c4fc7b5853bdb7e..326c34dbe61aca75fb7d8d6046900bd0331623bf 100644 (file)
@@ -1408,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
+
+
index 70c19c20ae5e85b0a7a6c8c136253d27608c38a1..4b4e47e045eb2abf31da476a0fcfd802427a97ee 100644 (file)
@@ -119,20 +119,6 @@ license is as follows:
 
 #include "wx/xpmdecod.h"
 
-#ifdef __WXWINCE__
-char* strdup(const char* s)
-{
-    char* s2 = new char[strlen(s)];
-    strcpy(s2, s);
-    return s2;
-}
-
-bool isspace(char c)
-{
-    return (c == ' ');
-}
-#endif
-
 #if wxUSE_STREAMS
 bool wxXPMDecoder::CanRead(wxInputStream& stream)
 {