]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4610: compile errors on Solaris 11.3 with Oracle Studio 12.5
authorStefan Kruger <stadtkind2@gmx.de>
Wed, 5 Oct 2016 14:24:30 +0000 (03:24 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 5 Oct 2016 14:24:30 +0000 (03:24 +1300)
Note: this patch is incomplete. Additional changes are required
to fully build Squid-4. see the bug report for details.

compat/debug.cc
compat/debug.h
src/HttpHdrCc.cc
src/HttpHdrCc.cci
src/Makefile.am
src/SquidNew.cc

index 12a904c6119251510f5d9ced6a57d76fd580dd71..918a22e60f15c4dda88b9146ae353384b4f499c1 100644 (file)
@@ -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 */
 
index 3b40d276490b19bf4ceae46a5a6c5e2f1afe0ad2..c71b2e0edb3182662f3885e63e946faaf041e7aa 100644 (file)
@@ -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,...);
index 9eeafce63eb3344779978a10572c83e752c3a9d6..d4d2090c0a259b30fa323d8caceb0616732a4430 100644 (file)
@@ -306,7 +306,7 @@ httpHdrCcStatDumper(StoreEntry * sentry, int, double val, double, int count)
 {
     extern const HttpHeaderStat *dump_stat; /* argh! */
     const int id = static_cast<int>(val);
-    const bool valid_id = id >= 0 && id < HttpHdrCcType::CC_ENUM_END;
+    const bool valid_id = id >= 0 && id < static_cast<int>(HttpHdrCcType::CC_ENUM_END);
     const char *name = valid_id ? CcAttrs[id].name : "INVALID";
 
     if (count || valid_id)
index e9bf90bbe78565b628f0b5cfacc6c1a667b54821..088adcc062ff67f861272c94e2ac3fe767f291d1 100644 (file)
@@ -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<long>(id));
 }
 
 void
 HttpHdrCc::setMask(HttpHdrCcType id, bool newval)
 {
     if (newval)
-        EBIT_SET(mask,id);
+        EBIT_SET(mask,static_cast<long>(id));
     else
-        EBIT_CLR(mask,id);
+        EBIT_CLR(mask, static_cast<long>(id));
 }
 
 /// set a data member to a new value, and set the corresponding mask-bit.
index 7557134021d70e80be2778cc507e30154a05bab6..41f16efd8839e09f5bb0205b0f9f343fd269b42b 100644 (file)
@@ -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 \
index d12353f1afbf2fb74c7e8af703c61a1b7a0331b8..ba4b8b6bd76e0aedde877320ee1f2cee6d6640e3 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "squid.h"
 
-#if !defined(__clang__)
+#if !defined(__clang__) && !defined(__SUNPRO_CC)
 
 #include <new>