From: serassio <> Date: Tue, 14 Aug 2007 23:05:47 +0000 (+0000) Subject: Forward port from 2.6 of definition of ISO C99 Standard printf() macros for 64 bit... X-Git-Tag: SQUID_3_0_PRE7~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce701a4581c4e434ca794f5c1252394679378b5d;p=thirdparty%2Fsquid.git Forward port from 2.6 of definition of ISO C99 Standard printf() macros for 64 bit integers --- diff --git a/include/squid_mswin.h b/include/squid_mswin.h index bd8991c245..9d2c8e7dcd 100755 --- a/include/squid_mswin.h +++ b/include/squid_mswin.h @@ -1,5 +1,5 @@ /* - * $Id: squid_mswin.h,v 1.4 2007/08/14 16:12:40 serassio Exp $ + * $Id: squid_mswin.h,v 1.5 2007/08/14 17:05:47 serassio Exp $ * * AUTHOR: Andrey Shorin * AUTHOR: Guido Serassio @@ -65,7 +65,6 @@ typedef unsigned long ino_t; #define INT64_MAX _I64_MAX #define INT64_MIN _I64_MIN -#define PRId64 "I64d" #include "default_config_file.h" /* Some tricks for MS Compilers */ diff --git a/src/squid.h b/src/squid.h index 59f661ecbe..518332998f 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.263 2007/08/14 16:12:41 serassio Exp $ + * $Id: squid.h,v 1.264 2007/08/14 17:05:47 serassio Exp $ * * AUTHOR: Duane Wessels * @@ -493,14 +493,29 @@ void free(V x) { fatal("Do not use ::free()"); } #define IPPROTO_TCP 0 #endif -#ifndef PRIu64 /* ISO C99 Standard printf() macro for 64 bit unsigned int */ -#ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */ +/* + * ISO C99 Standard printf() macros for 64 bit integers + * On some 64 bit platform, HP Tru64 is one, for printf must be used + * "%lx" instead of "%llx" + */ +#ifndef PRId64 +#ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */ +#define PRId64 "I64d" +#elif SIZEOF_INT64_T > SIZEOF_LONG +#define PRId64 "lld" +#else +#define PRId64 "ld" +#endif +#endif + +#ifndef PRIu64 +#ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */ #define PRIu64 "I64u" #elif SIZEOF_INT64_T > SIZEOF_LONG #define PRIu64 "llu" #else #define PRIu64 "lu" -#endif /* _SQUID_MSWIN_ */ -#endif /* PRIu64 */ +#endif +#endif #endif /* SQUID_H */