]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Split PRIuSIZE better
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 15 Jan 2012 02:22:39 +0000 (19:22 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 15 Jan 2012 02:22:39 +0000 (19:22 -0700)
compat/types.h

index cf531ec86ed5af6b8beeab7f71345daa4695ad4f..7e99e40a7b0227a62d7f0662d5420d5709ac4814 100644 (file)
 #endif
 
 #ifndef PRIuSIZE
-#if _SQUID_MINGW_ && SIZEOF_SIZE_T == 4
+// TODO: check for support of %zu and use where possible
+#if SIZEOF_SIZE_T == 4 && _SQUID_MINGW_
 #define PRIuSIZE "I32u"
-#elif _SQUID_MINGW_ && SIZEOF_SIZE_T == 8
+#elif SIZEOF_SIZE_T == 4
+#define PRIuSIZE "u"
+#elif SIZEOF_SIZE_T == 8 && _SQUID_MINGW_
 #define PRIuSIZE "I64u"
-#elif !_SQUID_MINGW_ && SIZEOF_SIZE_T == 8
+#elif SIZEOF_SIZE_T == 8
 #define PRIuSIZE "lu"
+#else
+#error size_t is not 32-bit or 64-bit
 #endif
-#endif
+#endif /* PRIuSIZE */
 
 #ifndef HAVE_MODE_T
 typedef unsigned short mode_t;