From: Amos Jeffries Date: Sun, 30 Jan 2011 05:24:12 +0000 (-0700) Subject: Compat: static functions cannot be passed externally with some compilers X-Git-Tag: SQUID_3_1_11~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a333edf853a126d9b29479aa1d26ce11bb8a754;p=thirdparty%2Fsquid.git Compat: static functions cannot be passed externally with some compilers 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. --- diff --git a/src/StatHist.cc b/src/StatHist.cc index 26092e7e11..55e279b8d1 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -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) {