]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Solaris compatiblity enhancements.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 24 Aug 2010 10:35:03 +0000 (12:35 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Tue, 24 Aug 2010 10:35:03 +0000 (12:35 +0200)
21 files changed:
acinclude/compiler-flags.m4
configure.in
helpers/ntlm_auth/fake/ntlm_fake_auth.cc
helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc
src/DiskIO/DiskThreads/aiops.cc
src/HttpHeader.cc
src/disk.cc
src/esi/Include.cc
src/esi/Include.h
src/icmp/net_db.h
src/ipcache.cc
src/mem.cc
src/protos.h
src/tests/stub_HttpReply.cc
tools/purge/conffile.hh
tools/purge/convert.hh
tools/purge/copyout.hh
tools/purge/purge.cc
tools/purge/signal.hh
tools/purge/socket.hh
tools/purge/squid-tlv.hh

index 6f806169ea1c246caba8667633180ef7a5e8a770..65221c7e4b78496552097e85f1b3f8a98ff6a09f 100644 (file)
@@ -100,6 +100,7 @@ AC_DEFUN([SQUID_CC_GUESS_VARIANT], [
 # options
 # They are (with their GCC equivalent):
 # squid_cv_cc_option_werror   (-Werror)
+# squid_cv_cxx_option_werror  (-Werror)
 # squid_cv_cc_option_wall     (-Wall)
 # squid_cv_cc_option_optimize (-O3)
 # 
@@ -109,17 +110,20 @@ AC_DEFUN([SQUID_CC_GUESS_OPTIONS], [
  case "$squid_cv_compiler" in
   gcc) 
    squid_cv_cc_option_werror="-Werror" 
+   squid_cv_cxx_option_werror="-Werror" 
    squid_cv_cc_option_wall="-Wall"
    squid_cv_cc_option_optimize="-O3"
    squid_cv_cc_arg_pipe="-pipe"
    ;;
   sunstudio) 
-   squid_cv_cc_option_werror="-errwarn=%all" 
+   squid_cv_cc_option_werror="-errwarn=%all -errtags" 
+   squid_cv_cxx_option_werror="-errwarn=%all,no%badargtype2w,no%wbadinit,no%wbadasg -errtags" 
    squid_cv_cc_option_wall="+w"
    squid_cv_cc_option_optimize="-fast"
    squid_cv_cc_arg_pipe=""
    ;;
   *) 
+   squid_cv_cxx_option_werror="" 
    squid_cv_cc_option_werror="" 
    squid_cv_cc_option_wall=""
    squid_cv_cc_option_optimize="-O"
index 61500805ef23491df090f5d46b2677429f519d29..81ef1b73e647ae1c87e3ba49e877763e81bc79e6 100644 (file)
@@ -281,7 +281,7 @@ fi
 
 if test "x$enable_strict_error_checking" != "xno"; then
   SQUID_CFLAGS="$SQUID_CFLAGS $squid_cv_cc_option_werror"
-  SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cc_option_werror"
+  SQUID_CXXFLAGS="$SQUID_CXXFLAGS $squid_cv_cxx_option_werror"
 fi
 
 AC_SUBST(SQUID_CFLAGS)
@@ -2281,6 +2281,7 @@ AC_TYPE_SIZE_T
 AC_TYPE_SSIZE_T
 AC_TYPE_OFF_T
 AC_TYPE_UID_T
+AC_CHECK_TYPE([bool])
 #need the defines for PRId64
 AC_CHECK_SIZEOF(int64_t)
 AC_CHECK_SIZEOF(long)
index 3943228bb482c7b0484ff74bf504eeb7bd0ddd31..73b8a35cc7876c860411350bdbb5577ed3fd73be 100644 (file)
 #define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n");
 #ifdef __GNUC__
 #define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
-#define SEND3(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
+#define SEND4(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
 #else
 /* no gcc, no debugging. varargs macros are a gcc extension */
 #define SEND2(X,Y) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
-#define SEND3(X,Y,Z) debug("sending '" X "' to squid\n",Y,Z); printf(X "\n",Y,Z);
+#define SEND4(X,Y,Z,W) debug("sending '" X "' to squid\n",Y,Z); printf(X "\n",Y,Z);
 #endif
 
 const char *authenticate_ntlm_domain = "WORKGROUP";
@@ -213,12 +213,12 @@ main(int argc, char *argv[])
                     if (strip_domain_enabled) {
                         SEND2("AF %s", user);
                     } else {
-                        SEND3("AF %s%s%s", domain, (*domain?"\\":""), user);
+                        SEND4("AF %s%s%s", domain, (*domain?"\\":""), user);
                     }
                 } else {
                     lc(user);
                     lc(domain);
-                    SEND3("NA invalid credentials, user=%s%s%s", domain, (*domain?"\\":""), user);
+                    SEND4("NA invalid credentials, user=%s%s%s", domain, (*domain?"\\":""), user);
                 }
             } else {
                 SEND("BH wrong packet type! user=");
index 2bd9a0d316b030830692a0f73aa9f807bef637aa..bef750d266b16d1ef7b1a36cc20d292b9e20f14d 100644 (file)
@@ -15,6 +15,7 @@
  */
 #define SQUID_NO_ALLOC_PROTECT 1
 #include "config.h"
+#include "compat/debug.h"
 #include "libntlmauth/ntlmauth.h"
 #include "libntlmauth/smb.h"
 #include "libntlmauth/rfcnb.h"
@@ -401,7 +402,7 @@ usage()
             my_program_name, my_program_name);
 }
 
-int debug_enabled=0;
+/* int debug_enabled=0; defined in libcompat */
 
 void
 process_options(int argc, char *argv[])
index ca753f7e32badf8282e3c44eec74680771ffd6e4..dadcfed3ed5096a7006f2fd937dc365bc93b8dfa 100644 (file)
@@ -108,7 +108,7 @@ struct squidaio_thread_t {
 
 static void squidaio_queue_request(squidaio_request_t *);
 static void squidaio_cleanup_request(squidaio_request_t *);
-static void *squidaio_thread_loop(void *);
+SQUIDCEXTERN void *squidaio_thread_loop(void *);
 static void squidaio_do_open(squidaio_request_t *);
 static void squidaio_do_read(squidaio_request_t *);
 static void squidaio_do_write(squidaio_request_t *);
@@ -360,7 +360,7 @@ squidaio_shutdown(void)
     squidaio_initialised = 0;
 }
 
-static void *
+void *
 squidaio_thread_loop(void *ptr)
 {
     squidaio_thread_t *threadp = (squidaio_thread_t *)ptr;
index 38807f4d8b6f2d7be3c4494af54000e8108fa213..d93f2f032f7c028b629b0c73e009641a529a4517 100644 (file)
@@ -1607,7 +1607,7 @@ httpHeaderNoteParsedEntry(http_hdr_type id, String const &context, int error)
 extern const HttpHeaderStat *dump_stat;                /* argh! */
 const HttpHeaderStat *dump_stat = NULL;
 
-static void
+void
 httpHeaderFieldStatDumper(StoreEntry * sentry, int idx, double val, double size, int count)
 {
     const int id = (int) val;
index a2ff08dabe4f73590fdd7414e4fb36a669c57c8b..29303dffe45f476ebed1ec75eb98e97c9df77dda 100644 (file)
@@ -54,6 +54,12 @@ disk_init(void)
     (void) 0;
 }
 
+/* hack needed on SunStudio to avoid linkage convention mismatch */
+static void cxx_xfree(void *ptr)
+{
+  xfree(ptr);
+}
+
 /*
  * opens a disk file specified by 'path'.  This function always
  * blocks!  There is no callback.
@@ -188,7 +194,7 @@ diskCombineWrites(struct _fde_disk *fdd)
 
         wq->next = NULL;
 
-        wq->free_func = xfree;
+        wq->free_func = cxx_xfree;
 
         do {
             q = fdd->write_q;
index d869b82204b8e137746804eaa1f298df8eace63b..797fbd3fdb2132ece6dc7d7d2788d856098b96f2 100644 (file)
@@ -116,7 +116,7 @@ esiBufferRecipient (clientStreamNode *node, ClientHttpRequest *http, HttpReply *
         if (rep) {
             if (rep->sline.status != HTTP_OK) {
                 rep = NULL;
-                esiStream->include->fail (esiStream);
+                esiStream->include->includeFail (esiStream);
                 esiStream->finished = 1;
                 httpRequestFree (http);
                 return;
@@ -168,7 +168,7 @@ esiBufferRecipient (clientStreamNode *node, ClientHttpRequest *http, HttpReply *
         /* XXX when reviewing ESI this is the first place to look */
         node->data = NULL;
         esiStream->finished = 1;
-        esiStream->include->fail (esiStream);
+        esiStream->include->includeFail (esiStream);
         return;
     };
 
@@ -185,7 +185,7 @@ esiBufferRecipient (clientStreamNode *node, ClientHttpRequest *http, HttpReply *
 
     case STREAM_FAILED:
         debugs(86, 1, "ESI subrequest failed transfer");
-        esiStream->include->fail (esiStream);
+        esiStream->include->includeFail (esiStream);
         esiStream->finished = 1;
         httpRequestFree (http);
         return;
@@ -472,7 +472,7 @@ ESIInclude::process (int dovars)
 }
 
 void
-ESIInclude::fail (ESIStreamContext::Pointer stream)
+ESIInclude::includeFail (ESIStreamContext::Pointer stream)
 {
     subRequestDone (stream, false);
 }
index d8b836cf749bb249ca74a696d4ce7c5b9aed3222..a364d5ebd1a5bb37f80f204874b8199a2d3455f5 100644 (file)
@@ -90,7 +90,7 @@ public:
     ESISegment::Pointer altcontent;
     ESIVarState *varState;
     char *srcurl, *alturl;
-    void fail(ESIStreamContext::Pointer);
+    void includeFail(ESIStreamContext::Pointer);
     void finish();
 
 private:
index 68794d4509137add5d540f6a9c9f08bc9c313bf5..97e1343b633d37373576e9228ab8cbcea9322a6b 100644 (file)
@@ -19,7 +19,7 @@ SQUIDCEXTERN void netdbInit(void);
 
 SQUIDCEXTERN void netdbHandlePingReply(const Ip::Address &from, int hops, int rtt);
 SQUIDCEXTERN void netdbPingSite(const char *hostname);
-SQUIDCEXTERN void netdbDump(StoreEntry *);
+void netdbDump(StoreEntry *);
 
 SQUIDCEXTERN void netdbFreeMemory(void);
 SQUIDCEXTERN int netdbHostHops(const char *host);
index 3210065853f493761704828da626c25346f9171f..20f1b3d3c51c978a23793ad98d4955e05f878bfa 100644 (file)
@@ -126,6 +126,9 @@ static struct _ipcache_stats {
 /// \ingroup IPCacheInternal
 static dlink_list lru_list;
 
+// forward-decls
+static void stat_ipcache_get(StoreEntry *);
+
 static FREE ipcacheFreeEntry;
 #if USE_DNSSERVERS
 static HLPCB ipcacheHandleReply;
index a94cf5545c1a887e3fb136e244523bb389105ede..eb7f554abd46176ae35e69f9798edc1375aba62b 100644 (file)
@@ -543,6 +543,12 @@ memFree64K(void *p)
     memFree(p, MEM_64K_BUF);
 }
 
+static void
+cxx_xfree(void * ptr)
+{
+  xfree(ptr);
+}
+
 FREE *
 memFreeBufFunc(size_t size)
 {
@@ -569,7 +575,7 @@ memFreeBufFunc(size_t size)
     default:
         memMeterDec(HugeBufCountMeter);
         memMeterDel(HugeBufVolumeMeter, size);
-        return xfree;
+        return cxx_xfree;
     }
 }
 
index a71cb5a4dfa592c270855262b5ac829aa6217104..572eba10caa0449493a0589f284d3332c1396a0b 100644 (file)
@@ -157,14 +157,14 @@ SQUIDCEXTERN void fqdncache_nbgethostbyaddr(const Ip::Address &, FQDNH *, void *
 
 SQUIDCEXTERN const char *fqdncache_gethostbyaddr(const Ip::Address &, int flags);
 SQUIDCEXTERN void fqdncache_init(void);
-SQUIDCEXTERN void fqdnStats(StoreEntry *);
+void fqdnStats(StoreEntry *);
 SQUIDCEXTERN void fqdncacheReleaseInvalid(const char *);
 
 SQUIDCEXTERN const char *fqdnFromAddr(const Ip::Address &);
 SQUIDCEXTERN int fqdncacheQueueDrain(void);
 SQUIDCEXTERN void fqdncacheFreeMemory(void);
 SQUIDCEXTERN void fqdncache_restart(void);
-SQUIDCEXTERN void fqdncache_purgelru(void *);
+void fqdncache_purgelru(void *);
 SQUIDCEXTERN void fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames);
 
 class FwdState;
@@ -250,7 +250,7 @@ SQUIDCEXTERN void httpHdrCcPackInto(const HttpHdrCc * cc, Packer * p);
 SQUIDCEXTERN void httpHdrCcSetMaxAge(HttpHdrCc * cc, int max_age);
 SQUIDCEXTERN void httpHdrCcSetSMaxAge(HttpHdrCc * cc, int s_maxage);
 SQUIDCEXTERN void httpHdrCcUpdateStats(const HttpHdrCc * cc, StatHist * hist);
-SQUIDCEXTERN void httpHdrCcStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
+void httpHdrCcStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);
 
 /* Http Header Tools */
 class HttpHeaderFieldInfo;
@@ -276,7 +276,7 @@ SQUIDCEXTERN void httpHeaderInitModule(void);
 SQUIDCEXTERN void httpHeaderCleanModule(void);
 
 /* store report about current header usage and other stats */
-SQUIDCEXTERN void httpHeaderStoreReport(StoreEntry * e);
+void httpHeaderStoreReport(StoreEntry * e);
 SQUIDCEXTERN void httpHdrMangleList(HttpHeader *, HttpRequest *, int req_or_rep);
 SQUIDCEXTERN int httpReqHdrManglersConfigured();
 
@@ -321,15 +321,14 @@ extern void wccp2ConnectionOpen(void);
 extern void wccp2ConnectionClose(void);
 #endif /* USE_WCCPv2 */
 
+void ipcache_purgelru(void *);
 SQUIDCEXTERN void ipcache_nbgethostbyname(const char *name,
         IPH * handler,
         void *handlerData);
-SQUIDCEXTERN void ipcache_purgelru(void *);
 SQUIDCEXTERN const ipcache_addrs *ipcache_gethostbyname(const char *, int flags);
 SQUIDCEXTERN void ipcacheInvalidate(const char *);
 SQUIDCEXTERN void ipcacheInvalidateNegative(const char *);
 SQUIDCEXTERN void ipcache_init(void);
-SQUIDCEXTERN void stat_ipcache_get(StoreEntry *);
 SQUIDCEXTERN void ipcacheCycleAddr(const char *name, ipcache_addrs *);
 SQUIDCEXTERN void ipcacheMarkBadAddr(const char *name, const Ip::Address &);
 SQUIDCEXTERN void ipcacheMarkGoodAddr(const char *name, const Ip::Address &);
@@ -556,12 +555,12 @@ SQUIDCEXTERN int storeClientIsThisAClient(store_client * sc, void *someClient);
 SQUIDCEXTERN const char *getMyHostname(void);
 SQUIDCEXTERN const char *uniqueHostname(void);
 SQUIDCEXTERN void safeunlink(const char *path, int quiet);
-SQUIDCEXTERN void death(int sig);
+void death(int sig);
 SQUIDCEXTERN void fatal(const char *message);
 SQUIDCEXTERN void fatalf(const char *fmt,...) PRINTF_FORMAT_ARG1;
 SQUIDCEXTERN void fatal_dump(const char *message);
-SQUIDCEXTERN void sigusr2_handle(int sig);
-SQUIDCEXTERN void sig_child(int sig);
+void sigusr2_handle(int sig);
+void sig_child(int sig);
 SQUIDCEXTERN void leave_suid(void);
 SQUIDCEXTERN void enter_suid(void);
 SQUIDCEXTERN void no_suid(void);
index 1e7a59953cec05340af963f3f232b30372623c8a..87a048ffb652b1aa3ecc3a4a6d311a107deef264 100644 (file)
@@ -47,7 +47,7 @@ HttpReply::~HttpReply()
 
 void
 HttpReply::setHeaders(http_status status, const char *reason,
-                      const char *ctype, int64_t clen, time_t lmt, time_t expires)
+                      const char *ctype, int64_t clen, time_t lmt, time_t expires_)
 {
     fatal ("Not implemented");
 }
index e2fc9cc58b70c58b05a9abd4e50ffae42b5a480d..ffb87c4e62520da9a11d1100faf406ea2cfdb543 100644 (file)
 #ifndef _CONFFILE_HH
 #define _CONFFILE_HH
 
+#if !defined(__cplusplus)
 #if defined(__GNUC__) || defined(__GNUG__)
 #pragma interface
 #else
-#ifndef HAS_BOOL
-#define HAS_BOOL
+#ifndef HAVE_BOOL
+#define HAVE_BOOL
 typedef int bool;
 #define false 0
 #define true  1
 #endif
 #endif
+#endif /* __cplusplus */
 
 
 #ifndef DEFAULT_SQUID_CONF
index 164f135a71a02ea17b963de2a23624246a8732a8..a2d9d40fa71e5764861192e274e0b1e0f857cc1b 100644 (file)
 #ifndef _CONVERT_HH
 #define _CONVERT_HH
 
+#if !defined(__cplusplus)
 #if defined(__GNUC__) || defined(__GNUG__)
 #pragma interface
 #else
-#ifndef HAS_BOOL
-#define HAS_BOOL
-typedef int bool;
+#ifndef HAVE_BOOL
+#define HAVE_BOOL 1
+typedef char bool;
 #define false 0
 #define true  1
 #endif
 #endif
+#endif /* __cplusplus */
 
 #include <sys/types.h>
 #include <sys/socket.h>
index f9fe80a49973e241401d6f36c3e65b69fd8eb183..2b4b6011f6300dfb327deebf0e7498bd162773b9 100644 (file)
 #ifndef _COPYOUT_HH
 #define _COPYOUT_HH
 
+#if !defined(__cplusplus)
 #if defined(__GNUC__) || defined(__GNUG__)
 #pragma interface
 #else
-#ifndef HAS_BOOL
-#define HAS_BOOL
+#ifndef HAVE_BOOL
+#define HAVE_BOOL
 typedef int bool;
 #define false 0
 #define true  1
 #endif
 #endif
+#endif /* __cplusplus */
 
 int
 assert_copydir( const char* copydir );
index c18909a0ec8fac0c9a3242ad150f9aaf5cc45826..9535ea2cdaf85284085d74e005932549ae0182ef 100644 (file)
@@ -146,7 +146,7 @@ volatile sig_atomic_t term_flag = 0; // 'terminate' is a gcc 2.8.x internal...
 char*  linebuffer = 0;
 size_t buffersize = 16834;
 static char* copydir = 0;
-static unsigned debug = 0;
+static unsigned debugFlag = 0;
 static unsigned purgeMode = 0;
 static bool iamalive = false;
 static bool reminder = false;
@@ -333,7 +333,7 @@ action( int fd, size_t metasize,
 
     // if we want to copy out the file, do that first of all.
     if ( ::copydir && *copydir && size > 0 )
-        copy_out( st.st_size, metasize, ::debug,
+        copy_out( st.st_size, metasize, ::debugFlag,
                   fn, url, ::copydir, ::envelope );
 
     // do we need to PURGE the file, yes, if purgemode bit#0 was set.
@@ -398,7 +398,7 @@ match( const char* fn, const REList* list )
     static const size_t addon = sizeof(unsigned char) + sizeof(unsigned int);
     bool flag = true;
 
-    if ( debug & 0x01 ) fprintf( stderr, "# [3] %s\n", fn );
+    if ( debugFlag & 0x01 ) fprintf( stderr, "# [3] %s\n", fn );
     int fd = open( fn, O_RDONLY );
     if ( fd != -1 ) {
         if ( read(fd,::linebuffer,::buffersize-1) > 60 ) {
@@ -481,7 +481,7 @@ filelevel( const char* directory, const REList* list )
 // returns: true, if every subdir && action was successful.
 {
     struct dirent* entry;
-    if ( debug & 0x01 )
+    if ( debugFlag & 0x01 )
         fprintf( stderr, "# [2] %s\n", directory );
 
     DIR* dir = opendir( directory );
@@ -523,7 +523,7 @@ dirlevel( const char* dirname, const REList* list, bool level=false )
 // warning: this function is once-recursive, no deeper.
 {
     struct dirent* entry;
-    if ( debug & 0x01 )
+    if ( debugFlag & 0x01 )
         fprintf( stderr, "# [%d] %s\n", (level ? 1 : 0), dirname );
 
     DIR* dir = opendir( dirname );
@@ -642,7 +642,7 @@ parseCommandline( int argc, char* argv[], REList*& head,
             break;
 
         case 'd':
-            ::debug = strtoul( optarg, 0, 0 );
+            ::debugFlag = strtoul( optarg, 0, 0 );
             break;
 
         case 'E':
@@ -738,7 +738,7 @@ parseCommandline( int argc, char* argv[], REList*& head,
     }
 
     // adjust
-    if ( ! isatty(fileno(stdout)) || (::debug & 0x01) ) ::iamalive = false;
+    if ( ! isatty(fileno(stdout)) || (::debugFlag & 0x01) ) ::iamalive = false;
     if ( head == 0 ) {
         fputs( "There was no regular expression defined. If you intend\n", stderr );
         fputs( "to match all possible URLs, use \"-e .\" instead.\n", stderr );
@@ -757,7 +757,7 @@ parseCommandline( int argc, char* argv[], REList*& head,
         printf( "#\n# Currently active values for %s:\n# %s\n",
                 ::programname, ::RCS_ID );
         printf( "# Debug level       : " );
-        if ( ::debug ) printf( "%#6.4hx", ::debug );
+        if ( ::debugFlag ) printf( "%#6.4hx", ::debugFlag );
         else printf( "production level" ); // printf omits 0x prefix for 0!
         printf( " + %s mode", ::no_fork ? "linear" : "parallel" );
         puts( ::verbose ? " + extra verbosity" : "" );
@@ -869,7 +869,7 @@ main( int argc, char* argv[] )
 
     // try to read squid.conf file to determine all cache_dir locations
     CacheDirVector cdv(0);
-    if ( readConfigFile( cdv, conffile, debug ? stderr : 0 ) > 0 ) {
+    if ( readConfigFile( cdv, conffile, debugFlag ? stderr : 0 ) > 0 ) {
         // there are some valid cache_dir entries.
         // unless forking was forbidden by cmdline option,
         // for a process for each cache_dir entry to remove files.
@@ -921,7 +921,7 @@ main( int argc, char* argv[] )
                         return 0;
                     } else {
                         // parent mode
-                        if ( ::debug ) printf( "forked child %d\n", (int) child[i] );
+                        if ( ::debugFlag ) printf( "forked child %d\n", (int) child[i] );
                     }
                 }
             }
@@ -932,7 +932,7 @@ main( int argc, char* argv[] )
             for ( size_t i=0; i < cdv.size(); ++i ) {
                 while ( (temp=waitpid( (pid_t)-1, &status, 0 )) == -1 )
                     if ( errno == EINTR ) continue;
-                if ( ::debug ) printf( "collected child %d\n", (int) temp );
+                if ( ::debugFlag ) printf( "collected child %d\n", (int) temp );
             }
             delete[] child;
         }
index 73d1cdfadfee05455a7dd35897a6766a95d49c61..8760624b4c1092f13f1a7fcc1273f9ee0e581d4e 100644 (file)
 #include <signal.h>
 #endif
 
+#if !defined(__cplusplus)
 #if defined(__GNUC__) || defined(__GNUG__)
 #pragma interface
 #else
-#ifndef HAS_BOOL
-#define HAS_BOOL
+#ifndef HAVE_BOOL
+#define HAVE_BOOL
 typedef int bool;
 #define false 0
 #define true  1
 #endif
 #endif
+#endif /* __cplusplus */
 
 #if 1 // so far, all systems I know use void
 # define SIGRETTYPE void
index e2bec356b85b111bc594caba76eefc2176e0a4fb..e6ef40c0b9371f5c8e8db7dc446c8386264f6859 100644 (file)
 #ifndef _SOCKET_HH
 #define _SOCKET_HH
 
+#if !defined(__cplusplus)
 #if defined(__GNUC__) || defined(__GNUG__)
 #pragma interface
 #else
-#ifndef HAS_BOOL
-#define HAS_BOOL
+#ifndef HAVE_BOOL
+#define HAVE_BOOL
 typedef int bool;
 #define false 0
 #define true  1
 #endif
 #endif
+#endif /* __cplusplus */
 
 #include <sys/types.h>
 #include <sys/socket.h>        // SOMAXCONN
index 08765ccccf7bc6087d70b35b2b3ddd584c2b9f02..a8531d2c1907d8154af01da42c90525bd7fe2230 100644 (file)
 #ifndef _SQUID_TLV_HH
 #define _SQUID_TLV_HH
 
+#if !defined(__cplusplus)
 #if defined(__GNUC__) || defined(__GNUG__)
 #pragma interface
 #else
-#ifndef HAS_BOOL
-#define HAS_BOOL
+#ifndef HAVE_BOOL
+#define HAVE_BOOL
 typedef int bool;
 #define false 0
 #define true  1
 #endif
 #endif
+#endif /* __cplusplus */
 
 #include <sys/types.h>
 #include <netinet/in.h>
@@ -66,7 +68,7 @@ enum SquidMetaType {
   STORE_META_VALID,
   STORE_META_VARY_HEADERS,     // Stores Vary request headers
   STORE_META_STD_LFS,          // standard metadata in lfs format
-  STORE_META_OBJSIZE,          // object size, if its known
+  STORE_META_OBJSIZE           // object size, if its known
 };
 
 // taken from Squid-2.x