]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - compat/compat.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / compat / compat.h
index ee2d231af73f3f8660a23da90cc8b9c624845d49..ec72e60a9dece31cce9392af2c32bdaae28985c3 100644 (file)
@@ -1,9 +1,17 @@
+/*
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #ifndef _SQUID_COMPAT_H
 #define _SQUID_COMPAT_H
 
 /*
  * From discussions it was chosen to push compat code as far down as possible.
- * That means we can have a seperate compat for most
+ * That means we can have a separate compat for most
  *  compatability and portability hacks and resolutions.
  *
  * This file is meant to collate all those hacks files together and
 /******************************************************/
 #include "compat/osdetect.h"
 
-/* ugly hack. But we need to set this REALLY soon in the header */
-#if _SQUID_SOLARIS_ && !defined(__GNUC__) && !defined(__GNUG__)
-#ifndef __EXTENSIONS__
-#define __EXTENSIONS__ 1
-#endif
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 1
-#endif
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED 1
+/* Solaris 10 has a broken definition for minor_t in IPFilter compat.
+ * We must pre-define before doing anything with OS headers so the OS
+ * do not. Then un-define it before using the IPFilter *_compat.h headers.
+ */
+#if IPF_TRANSPARENT && USE_SOLARIS_IPFILTER_MINOR_T_HACK
+/* But we only need do this nasty thing for src/ip/Intercept.cc */
+#if BUILDING_SQUID_IP_INTERCEPT_CC
+#define minor_t solaris_minor_t_fubar
 #endif
 #endif
 
@@ -56,6 +62,7 @@
 /*****************************************************/
 
 #include "compat/os/aix.h"
+#include "compat/os/android.h"
 #include "compat/os/dragonfly.h"
 #include "compat/os/freebsd.h"
 #include "compat/os/hpux.h"
 
 #include "compat/assert.h"
 #include "compat/compat_shared.h"
+#include "compat/getaddrinfo.h"
+#include "compat/getnameinfo.h"
+#include "compat/inet_ntop.h"
+#include "compat/inet_pton.h"
 #include "compat/stdvarargs.h"
 
 /* cstdio has a bunch of problems with 64-bit definitions */
 #include "compat/stdio.h"
 
+/* POSIX statvfs() is still not universal */
+#include "compat/statvfs.h"
+
 /*****************************************************/
 /* component-specific portabilities                  */
 /*****************************************************/
 /* Valgrind API macros changed between two versions squid supports */
 #include "compat/valgrind.h"
 
-/* Endian functions are usualy handled by the OS but not always. */
-#include "squid_endian.h"
-
 /**
  * A Regular Expression library is bundled with Squid.
  * Default is to use a system provided one, but the bundle
 #include "compat/cppunit.h"
 
 #endif /* _SQUID_COMPAT_H */
+