1 /*
2  * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef _SQUID_COMPAT_H
10 #define _SQUID_COMPAT_H
11 
12 /*
13  * From discussions it was chosen to push compat code as far down as possible.
14  * That means we can have a separate compat for most
15  *  compatability and portability hacks and resolutions.
16  *
17  * This file is meant to collate all those hacks files together and
18  * provide a simple include for them in the core squid headers
19  * (presently squid.h)
20  *
21  * It should not be included directly in any of the squid sources.
22  * If your code requires any symbols from here you should be importing
23  * squid.h at the top line of your .cc file.
24  */
25 
26 /******************************************************/
27 /* Define the _SQUID_TYPE_ based on a guess of the OS */
28 /* NP: this MUST come first within compat.h           */
29 /******************************************************/
30 #include "compat/osdetect.h"
31 
32 /*****************************************************/
33 /* FDSETSIZE is messy and needs to be done before    */
34 /* sys/types.h are defined.                          */
35 /*****************************************************/
36 #include "compat/fdsetsize.h"
37 
38 /*****************************************************/
39 /* Global type re-definitions                        */
40 /* this also takes care of the basic system includes */
41 /*****************************************************/
42 
43 /** On linux this must be defined to get PRId64 and friends */
44 #define __STDC_FORMAT_MACROS
45 
46 #include "compat/types.h"
47 
48 /*****************************************************/
49 /* per-OS hacks. One file per OS.                    */
50 /* OS-macro wrapping should be done inside the OS .h */
51 /*****************************************************/
52 
53 #include "compat/os/aix.h"
54 #include "compat/os/android.h"
55 #include "compat/os/dragonfly.h"
56 #include "compat/os/freebsd.h"
57 #include "compat/os/hpux.h"
58 #include "compat/os/linux.h"
59 #include "compat/os/macosx.h"
60 #include "compat/os/mswindows.h"
61 #include "compat/os/netbsd.h"
62 #include "compat/os/next.h"
63 #include "compat/os/openbsd.h"
64 #include "compat/os/os2.h"
65 #include "compat/os/qnx.h"
66 #include "compat/os/sgi.h"
67 #include "compat/os/solaris.h"
68 #include "compat/os/sunos.h"
69 
70 /*****************************************************/
71 /* portabilities shared between all platforms and    */
72 /* components as found to be needed                  */
73 /*****************************************************/
74 
75 #include "compat/assert.h"
76 #include "compat/compat_shared.h"
77 #include "compat/getaddrinfo.h"
78 #include "compat/getnameinfo.h"
79 #include "compat/inet_ntop.h"
80 #include "compat/inet_pton.h"
81 #include "compat/stdvarargs.h"
82 
83 /* cstdio has a bunch of problems with 64-bit definitions */
84 #include "compat/stdio.h"
85 
86 /* POSIX statvfs() is still not universal */
87 #include "compat/statvfs.h"
88 
89 /*****************************************************/
90 /* component-specific portabilities                  */
91 /*****************************************************/
92 
93 /* helper debugging requires some hacks to be clean */
94 #include "compat/debug.h"
95 
96 /* Valgrind API macros changed between two versions squid supports */
97 #include "compat/valgrind.h"
98 
99 /**
100  * A Regular Expression library is bundled with Squid.
101  * Default is to use a system provided one, but the bundle
102  * may be used instead with explicit configuration.
103  */
104 #include "compat/GnuRegex.h"
105 
106 /* cppunit is not quite C++0x compatible yet */
107 #include "compat/cppunit.h"
108 
109 #endif /* _SQUID_COMPAT_H */
110 
111