From 76b513074d36a353916f9cf134106ad1605e66ee Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 13 May 2011 13:29:59 +0000 Subject: [PATCH] Define wx[U]IntPtr as long, not [s]size_t, in 32 bit builds. 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 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index f31d1e1bdd..3b66b2e0a4 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -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 -- 2.45.2