From: serassio <> Date: Wed, 15 Aug 2007 01:17:43 +0000 (+0000) Subject: Fix build errors on HP Tru64 Unix and may be others X-Git-Tag: SQUID_3_0_PRE7~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d883d1fa06364cb8bb95405c96abb0169a0083f;p=thirdparty%2Fsquid.git Fix build errors on HP Tru64 Unix and may be others - xusleep.c: on Tru64 timeval is defined in sys/time.h - move the definition of ISO C99 Standard printf() macros for 64 bit integers from squid.h to squid_types.h --- diff --git a/include/squid_types.h b/include/squid_types.h index 927e3f2199..720d370b64 100644 --- a/include/squid_types.h +++ b/include/squid_types.h @@ -1,5 +1,5 @@ /* - * $Id: squid_types.h,v 1.8 2003/06/01 09:01:41 hno Exp $ + * $Id: squid_types.h,v 1.9 2007/08/14 19:17:43 serassio Exp $ * * * * * * * * * Legal stuff * * * * * * * * @@ -74,4 +74,29 @@ #include #endif +/* + * 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 +#endif + #endif /* SQUID_TYPES_H */ diff --git a/lib/util.c b/lib/util.c index 953cf9db33..ad698708bc 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.96 2007/08/13 17:20:50 hno Exp $ + * $Id: util.c,v 1.97 2007/08/14 19:17:43 serassio Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -924,7 +924,7 @@ const char * xint64toa(int64_t num) { static char buf[24]; /* 2^64 = 18446744073709551616 */ - snprintf(buf, sizeof(buf), "%"PRId64, num); + snprintf(buf, sizeof(buf), "%" PRId64, num); return buf; } diff --git a/lib/xusleep.c b/lib/xusleep.c index e51afd37d1..f32e2c8db7 100644 --- a/lib/xusleep.c +++ b/lib/xusleep.c @@ -8,6 +8,9 @@ #if HAVE_UNISTD_H #include #endif +#if HAVE_SYS_TIME_H +#include +#endif #if HAVE_SYS_SELECT_H #include #endif diff --git a/src/squid.h b/src/squid.h index 518332998f..518ce6554b 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.264 2007/08/14 17:05:47 serassio Exp $ + * $Id: squid.h,v 1.265 2007/08/14 19:17:45 serassio Exp $ * * AUTHOR: Duane Wessels * @@ -493,29 +493,4 @@ void free(V x) { fatal("Do not use ::free()"); } #define IPPROTO_TCP 0 #endif -/* - * 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 -#endif - #endif /* SQUID_H */