]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Compat: static functions cannot be passed externally with some compilers
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 30 Jan 2011 05:24:12 +0000 (22:24 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 30 Jan 2011 05:24:12 +0000 (22:24 -0700)
Solaris StudioCC, HPUX and old GCC complain about statics being passed
by pointers outside the current file.
Elected to drop 'static' instead of adding a bunch of specific wrapper hacks.

src/StatHist.cc

index 26092e7e118998b7b4dbfc03e899cd7d7e80648e..55e279b8d18b5dbfa2f4c1e1cb71a8579616ad29 100644 (file)
@@ -53,15 +53,10 @@ static void statHistInit(StatHist * H, int capacity, hbase_f * val_in, hbase_f *
 static int statHistBin(const StatHist * H, double v);
 static double statHistVal(const StatHist * H, int bin);
 static StatHistBinDumper statHistBinDumper;
-#if !defined(_SQUID_HPUX_) || !defined(__GNUC__)
-/*
- * HP-UX and GCC (2.8?) give strange errors when these simple
- * functions are static.
- */
-static hbase_f Log;
-static hbase_f Exp;
-static hbase_f Null;
-#endif
+
+hbase_f Log;
+hbase_f Exp;
+hbase_f Null;
 
 /* low level init, higher level functions has less params */
 static void
@@ -274,9 +269,6 @@ statHistDump(const StatHist * H, StoreEntry * sentry, StatHistBinDumper * bd)
 }
 
 /* log based histogram */
-#if !defined(_SQUID_HPUX_) || !defined(__GNUC__)
-static
-#endif
 double
 Log(double x)
 {
@@ -284,9 +276,6 @@ Log(double x)
     return log(x + 1.0);
 }
 
-#if !defined(_SQUID_HPUX_) || !defined(__GNUC__)
-static
-#endif
 double
 Exp(double x)
 {
@@ -301,9 +290,6 @@ statHistLogInit(StatHist * H, int capacity, double min, double max)
 
 /* linear histogram for enums */
 /* we want to be have [-1,last_enum+1] range to track out of range enums */
-#if !defined(_SQUID_HPUX_) || !defined(__GNUC__)
-static
-#endif
 double
 Null(double x)
 {