From: Stefan Kruger Date: Wed, 5 Oct 2016 14:24:30 +0000 (+1300) Subject: Bug 4610: compile errors on Solaris 11.3 with Oracle Studio 12.5 X-Git-Tag: SQUID_4_0_15~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a45f2153c545b2ccc92fc8e2fdd8bae57935107f;p=thirdparty%2Fsquid.git Bug 4610: compile errors on Solaris 11.3 with Oracle Studio 12.5 Note: this patch is incomplete. Additional changes are required to fully build Squid-4. see the bug report for details. --- diff --git a/compat/debug.cc b/compat/debug.cc index 12a904c611..918a22e60f 100644 --- a/compat/debug.cc +++ b/compat/debug.cc @@ -12,7 +12,7 @@ /* default off */ int debug_enabled = 0; -#ifndef __GNUC__ +#if !defined(__GNUC__) && !defined(__SUNPRO_CC) /* under gcc a macro define in compat/debug.h is used instead */ void @@ -26,5 +26,5 @@ debug(const char *format,...) va_end(args); } -#endif /* __GNUC__ */ +#endif /* __GNUC__ || __SUNPRO_CC */ diff --git a/compat/debug.h b/compat/debug.h index 3b40d27649..c71b2e0edb 100644 --- a/compat/debug.h +++ b/compat/debug.h @@ -23,7 +23,7 @@ SQUIDCEXTERN int debug_enabled; /* the macro overload style is really a gcc-ism */ -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__SUNPRO_CC) #define debug(X...) \ if (debug_enabled) { \ @@ -37,7 +37,7 @@ SQUIDCEXTERN int debug_enabled; << content << std::endl; \ } else (void)0 -#else /* __GNUC__ */ +#else /* __GNUC__ || __SUNPRO_CC */ /* non-GCC compilers can't do the above macro define yet. */ void debug(const char *format,...); diff --git a/src/HttpHdrCc.cc b/src/HttpHdrCc.cc index 9eeafce63e..d4d2090c0a 100644 --- a/src/HttpHdrCc.cc +++ b/src/HttpHdrCc.cc @@ -306,7 +306,7 @@ httpHdrCcStatDumper(StoreEntry * sentry, int, double val, double, int count) { extern const HttpHeaderStat *dump_stat; /* argh! */ const int id = static_cast(val); - const bool valid_id = id >= 0 && id < HttpHdrCcType::CC_ENUM_END; + const bool valid_id = id >= 0 && id < static_cast(HttpHdrCcType::CC_ENUM_END); const char *name = valid_id ? CcAttrs[id].name : "INVALID"; if (count || valid_id) diff --git a/src/HttpHdrCc.cci b/src/HttpHdrCc.cci index e9bf90bbe7..088adcc062 100644 --- a/src/HttpHdrCc.cci +++ b/src/HttpHdrCc.cci @@ -15,16 +15,16 @@ bool HttpHdrCc::isSet(HttpHdrCcType id) const { assert(id < HttpHdrCcType::CC_ENUM_END); - return EBIT_TEST(mask,id); + return EBIT_TEST(mask, static_cast(id)); } void HttpHdrCc::setMask(HttpHdrCcType id, bool newval) { if (newval) - EBIT_SET(mask,id); + EBIT_SET(mask,static_cast(id)); else - EBIT_CLR(mask,id); + EBIT_CLR(mask, static_cast(id)); } /// set a data member to a new value, and set the corresponding mask-bit. diff --git a/src/Makefile.am b/src/Makefile.am index 7557134021..41f16efd88 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -547,11 +547,11 @@ squid_LDADD = \ fs/libfs.la \ DiskIO/libdiskio.la \ comm/libcomm.la \ + anyp/libanyp.la \ security/libsecurity.la \ $(SSL_LIBS) \ ipc/libipc.la \ mgr/libmgr.la \ - anyp/libanyp.la \ parser/libparser.la \ eui/libeui.la \ icmp/libicmp.la \ diff --git a/src/SquidNew.cc b/src/SquidNew.cc index d12353f1af..ba4b8b6bd7 100644 --- a/src/SquidNew.cc +++ b/src/SquidNew.cc @@ -10,7 +10,7 @@ #include "squid.h" -#if !defined(__clang__) +#if !defined(__clang__) && !defined(__SUNPRO_CC) #include