From: Stefan Kruger Date: Tue, 17 Jan 2017 19:29:06 +0000 (+1300) Subject: Bug 4610: fix 'Assigning a negative value to an implicit unsigned bitfield' on Solaris 11 X-Git-Tag: M-staged-PR71~305 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=351c3eb46c9d2db8df4532e565deb9ef134812b9;p=thirdparty%2Fsquid.git Bug 4610: fix 'Assigning a negative value to an implicit unsigned bitfield' on Solaris 11 --- diff --git a/src/store/forward.h b/src/store/forward.h index 8ae1894635..d5b0d12684 100644 --- a/src/store/forward.h +++ b/src/store/forward.h @@ -9,7 +9,17 @@ #ifndef SQUID_STORE_FORWARD_H #define SQUID_STORE_FORWARD_H -typedef int32_t sfileno; +// bug 4610 see comments 22-38 +// Nasty hack, but it turns out C++ allows int32_t to be +// unsigned when used as a bitmask (as sfile* are later) +#if INT_MAX == INT32_MAX +typedef signed int signed_int32_t; +#elif SHORT_MAX == INT32_MAX +typedef signed short int signed_int32_t; +#else +#error I do not know how to typedef a signed 32bit integer. +#endif +typedef signed_int32_t sfileno; typedef signed int sdirno; /// maximum number of entries per cache_dir