]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: shuffle out the last useful macros from squid-old.h
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 9 Aug 2012 10:32:57 +0000 (22:32 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 9 Aug 2012 10:32:57 +0000 (22:32 +1200)
compat/os/next.h
include/leakcheck.h [new file with mode: 0644]
include/squid.h
src/squid-old.h

index 556777e3848a3abbafed1c3b6c9e883e8040da6e..7fd8240d8f903e39862aa7a40b94f59e2612607c 100644 (file)
@@ -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 */
diff --git a/include/leakcheck.h b/include/leakcheck.h
new file mode 100644 (file)
index 0000000..acb05ef
--- /dev/null
@@ -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
index 34ae37b4170c50f8e3eccd8f76449ec08867f467..b5ecdeb3040816cf65894bf17f4b2e4c488fc412 100644 (file)
 /* 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 */
index a5ccf4953ebbf976bea656ca0910b92197ca6c43..9c54dc2466febb4b43a820b45a954a1afab234b8 100644 (file)
 
 #include "squid.h"
 
-#if _SQUID_MSWIN_
-/** \cond AUTODOCS-IGNORE */
-using namespace Squid;
-/** \endcond */
-#endif
-
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -140,19 +134,6 @@ using namespace Squid;
 #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"