Define wx[U]IntPtr as long, not [s]size_t, in 32 bit builds.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 13 May 2011 13:29:59 +0000 (13:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 13 May 2011 13:29:59 +0000 (13:29 +0000)
Defining wxIntPtr as ssize_t or long in 32 bit builds doesn't really change
anything but using long means that we can replace longs in the existing API
with wxIntPtr without breaking compatibility, like in wxListCtrl::SortItems().
It is also more compatible with 64 bit builds where wxIntPtr is long already.
So it has some minor advantages and no apparent drawbacks.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67732 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h

index f31d1e1bdd6b21cb306f35f6d30eed37a37663fa..3b66b2e0a46ba00746d44fa39582c68b291cb4ac 100644 (file)
@@ -1162,7 +1162,13 @@ typedef wxUint32 wxDword;
    Define signed and unsigned integral types big enough to contain all of long,
    size_t and void *.
  */
-#if SIZEOF_SIZE_T >= SIZEOF_VOID_P
+#if SIZEOF_LONG >= SIZEOF_VOID_P
+    /*
+       Normal case when long is the largest integral type.
+     */
+    typedef long wxIntPtr;
+    typedef unsigned long wxUIntPtr;
+#elif SIZEOF_SIZE_T >= SIZEOF_VOID_P
     /*
        Win64 case: size_t is the only integral type big enough for "void *".
 
@@ -1172,12 +1178,6 @@ typedef wxUint32 wxDword;
      */
     typedef wxW64 ssize_t wxIntPtr;
     typedef size_t wxUIntPtr;
-#elif SIZEOF_LONG >= SIZEOF_VOID_P
-    /*
-       Normal case when long is the largest integral type.
-     */
-    typedef long wxIntPtr;
-    typedef unsigned long wxUIntPtr;
 #else
     /*
        This should never happen for the current architectures but if you're