------------------------------------------------------------ revno: 12264 revision-id: squid3@treenet.co.nz-20120809103257-40caxr5w6ie0ck2o parent: squidadm@squid-cache.org-20120809001247-chhwizmvb41ezxjx committer: Amos Jeffries branch nick: trunk timestamp: Thu 2012-08-09 22:32:57 +1200 message: Portability: shuffle out the last useful macros from squid-old.h ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20120809103257-40caxr5w6ie0ck2o # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 83b6262ccfc4680b3c41d58167f80f1bbe8f24bc # timestamp: 2012-08-09 10:54:02 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squidadm@squid-cache.org-20120809001247-\ # chhwizmvb41ezxjx # # Begin patch === modified file 'compat/os/next.h' --- compat/os/next.h 2011-07-23 08:37:52 +0000 +++ compat/os/next.h 2012-08-09 10:32:57 +0000 @@ -42,5 +42,9 @@ #undef HAVE_NETDB_H #define HAVE_NETDB_H 0 +#if !defined(S_ISDIR) +#define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR)) +#endif + #endif /* _SQUID_NEXT_ */ #endif /* SQUID_OS_NEXT_H */ === added file 'include/leakcheck.h' --- include/leakcheck.h 1970-01-01 00:00:00 +0000 +++ include/leakcheck.h 2012-08-09 10:32:57 +0000 @@ -0,0 +1,13 @@ +#ifndef _SQUID_LEAKCHECK_H +#define _SQUID_LEAKCHECK_H + +#if LEAK_CHECK_MODE && 0 /* doesn't work at the moment */ +#define LOCAL_ARRAY(type,name,size) \ + static type *local_##name=NULL; \ + type *name = local_##name ? local_##name : \ + ( local_##name = (type *)xcalloc(size, sizeof(type)) ) +#else +#define LOCAL_ARRAY(type,name,size) static type name[size] +#endif + +#endif === modified file 'include/squid.h' --- include/squid.h 2012-01-20 18:55:04 +0000 +++ include/squid.h 2012-08-09 10:32:57 +0000 @@ -116,4 +116,11 @@ /* temp hack: needs to be pre-defined for now. */ #define SQUID_MAXPATHLEN 256 +// TODO: determine if this is required. OR if compat/os/mswin.h works +#if _SQUID_MSWIN_ +/** \cond AUTODOCS-IGNORE */ +using namespace Squid; +/** \endcond */ +#endif + #endif /* SQUID_CONFIG_H */ === modified file 'src/squid-old.h' --- src/squid-old.h 2012-01-20 18:55:04 +0000 +++ src/squid-old.h 2012-08-09 10:32:57 +0000 @@ -34,12 +34,6 @@ #include "squid.h" -#if _SQUID_MSWIN_ -/** \cond AUTODOCS-IGNORE */ -using namespace Squid; -/** \endcond */ -#endif - #if HAVE_UNISTD_H #include #endif @@ -140,19 +134,6 @@ #define MAXPATHLEN SQUID_MAXPATHLEN #endif -#if LEAK_CHECK_MODE -#define LOCAL_ARRAY(type,name,size) \ - static type *local_##name=NULL; \ - type *name = local_##name ? local_##name : \ - ( local_##name = (type *)xcalloc(size, sizeof(type)) ) -#else -#define LOCAL_ARRAY(type,name,size) static type name[size] -#endif - -#if _SQUID_NEXT_ && !defined(S_ISDIR) -#define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR)) -#endif - #include "md5.h" #if SQUID_SNMP #include "cache_snmp.h"