]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't assume size_t is either int- or long-sized.
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 1 Jul 2010 14:30:29 +0000 (14:30 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 1 Jul 2010 14:30:29 +0000 (14:30 +0000)
On 64bit Windows systems, sizeof(int)==sizeof(long)=4, but size_t is 8
bytes large.

Fixes #12179.

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

include/wx/defs.h
include/wx/strvararg.h

index 0a76ab191fd3320364b222a9812f3d1d1dcb2493..33a0c79c0c9d676fcadccccb956c91fbb3f1b1d6 100644 (file)
@@ -929,10 +929,6 @@ typedef wxUint16 wxWord;
     #error "SIZEOF_WCHAR_T must be defined, but isn't"
 #endif
 
-#if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
-    #error "wxSIZE_T_IS_UINT or wxSIZE_T_IS_ULONG must be defined"
-#endif
-
 /* also define C99-like sized MIN/MAX constants */
 #define wxINT8_MIN CHAR_MIN
 #define wxINT8_MAX CHAR_MAX
index ae70e64b1751e66f25c19381640ea75f8355d602..cc14ce2ddba1bbd9009dc4980cc4552b9e6a4945 100644 (file)
@@ -173,16 +173,19 @@ public:
         Arg_Double      = 0x0040,
         Arg_LongDouble  = 0x0080,
 
-#ifdef wxSIZE_T_IS_UINT
+#if defined(wxSIZE_T_IS_UINT)
         Arg_Size_t      = Arg_Int,
-#endif
-#ifdef wxSIZE_T_IS_ULONG
+#elif defined(wxSIZE_T_IS_ULONG)
         Arg_Size_t      = Arg_LongInt,
+#elif defined(SIZEOF_LONG_LONG) && SIZEOF_SIZE_T == SIZEOF_LONG_LONG
+        Arg_Size_t      = Arg_LongLongInt,
+#else
+        Arg_Size_t      = 0x0100,
 #endif
 
-        Arg_IntPtr      = 0x0100,    // %n -- store # of chars written
-        Arg_ShortIntPtr = 0x0200,
-        Arg_LongIntPtr  = 0x0400,
+        Arg_IntPtr      = 0x0200,    // %n -- store # of chars written
+        Arg_ShortIntPtr = 0x0400,
+        Arg_LongIntPtr  = 0x0800,
 
         Arg_Unknown     = 0x8000     // unrecognized specifier (likely error)
     };