From: Amos Jeffries Date: Sun, 15 Jan 2012 02:22:39 +0000 (-0700) Subject: Split PRIuSIZE better X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb02d684f737da12eecbe22564d4356efd8f545f;p=thirdparty%2Fsquid.git Split PRIuSIZE better --- diff --git a/compat/types.h b/compat/types.h index cf531ec86e..7e99e40a7b 100644 --- a/compat/types.h +++ b/compat/types.h @@ -123,14 +123,19 @@ #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;