]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/string.h
For non-Unicode added #include <ctype.h> and <string.h> to avoid some missing
[wxWidgets.git] / include / wx / string.h
index 518b8f5f79732278439b9859b77982b9f1d51322..ade4672b4d2fa66267f9ccf5e9303de65352ae23 100644 (file)
 #include <limits.h>
 #include <stdlib.h>
 
+#ifdef HAVE_STRINGS_H
+    #include <strings.h>    // for strcasecmp()
+#endif // AIX
+
 #ifndef  WX_PRECOMP
   #include "wx/defs.h"
 
@@ -62,7 +66,7 @@ const unsigned int wxSTRING_MAXLEN = UINT_MAX - 100;
 #define   WXSTRINGCAST (char *)(const char *)
 
 // implementation only
-#define   ASSERT_VALID_INDEX(i) wxASSERT( (unsigned)(i) < Len() )
+#define   ASSERT_VALID_INDEX(i) wxASSERT( (unsigned)(i) <= Len() )
 
 // ---------------------------------------------------------------------------
 // Global functions complementing standard C string library replacements for
@@ -316,9 +320,10 @@ public:
     char& Last()
       { wxASSERT( !IsEmpty() ); CopyBeforeWrite(); return m_pchData[Len()-1]; }
 
-    // on alpha-linux this gives overload problems:
-    // Also on Solaris, so removing for now (JACS)
-#if ! defined(__ALPHA__)
+    // under Unix it is tested with configure, assume it works on other
+    // platforms (there might be overloading problems if size_t and int are
+    // the same type)
+#if !defined(__UNIX__) || wxUSE_SIZE_T_STRING_OPERATOR
     // operator version of GetChar
     char  operator[](size_t n) const
       { ASSERT_VALID_INDEX( n ); return m_pchData[n]; }