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