]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/compat.h
Merge from trunk. Remove dead files and fluff changes
[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 and config.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 * config.h/squid.h at the top line of your .cc or .h file.
16 */
17
18
19 /******************************************************/
20 /* Define the _SQUID_TYPE_ based on a guess of the OS */
21 /* NP: this MUST come first within compat.h */
22 /******************************************************/
23 #include "compat/osdetect.h"
24
25 /* ugly hack. But we need to set this REALLY soon in the header */
26 #if _SQUID_SOLARIS_ && !defined(__GNUC__) && !defined(__GNUG__)
27 #ifndef __EXTENSIONS__
28 #define __EXTENSIONS__ 1
29 #endif
30 #ifndef _XOPEN_SOURCE
31 #define _XOPEN_SOURCE 1
32 #endif
33 #ifndef _XOPEN_SOURCE_EXTENDED
34 #define _XOPEN_SOURCE_EXTENDED 1
35 #endif
36 #endif
37
38
39
40 /*****************************************************/
41 /* FDSETSIZE is messy and needs to be done before */
42 /* sys/types.h are defined. */
43 /*****************************************************/
44 #include "compat/fdsetsize.h"
45
46
47 /*****************************************************/
48 /* Global type re-definitions */
49 /* this also takes care of the basic system includes */
50 /*****************************************************/
51
52 /** On linux this must be defined to get PRId64 and friends */
53 #define __STDC_FORMAT_MACROS
54
55 #include "compat/types.h"
56
57 /*****************************************************/
58 /* per-OS hacks. One file per OS. */
59 /* OS-macro wrapping should be done inside the OS .h */
60 /*****************************************************/
61
62 #include "compat/os/aix.h"
63 #include "compat/os/dragonfly.h"
64 #include "compat/os/freebsd.h"
65 #include "compat/os/hpux.h"
66 #include "compat/os/linux.h"
67 #include "compat/os/macosx.h"
68 #include "compat/os/mswin.h"
69 #include "compat/os/netbsd.h"
70 #include "compat/os/next.h"
71 #include "compat/os/openbsd.h"
72 #include "compat/os/os2.h"
73 #include "compat/os/qnx.h"
74 #include "compat/os/sgi.h"
75 #include "compat/os/solaris.h"
76 #include "compat/os/sunos.h"
77 #include "compat/os/windows.h"
78
79
80 /*****************************************************/
81 /* portabilities shared between all platforms and */
82 /* components as found to be needed */
83 /*****************************************************/
84
85 #include "compat/compat_shared.h"
86 #include "compat/stdvarargs.h"
87 #include "compat/assert.h"
88
89 /* cstdio has a bunch of problems with 64-bit definitions */
90 #include "compat/stdio.h"
91
92
93 /*****************************************************/
94 /* component-specific portabilities */
95 /*****************************************************/
96
97 /* helper debugging requires some hacks to be clean */
98 #include "compat/debug.h"
99
100 /* Valgrind API macros changed between two versions squid supports */
101 #include "compat/valgrind.h"
102
103 /* Endian functions are usualy handled by the OS but not always. */
104 #include "squid_endian.h"
105
106 /**
107 * A Regular Expression library is bundled with Squid.
108 * Default is to use a system provided one, but the bundle
109 * may be used instead with explicit configuration.
110 */
111 #include "compat/GnuRegex.h"
112
113 /* some functions are unsafe to be used in Squid. */
114 #include "compat/unsafe.h"
115
116 #endif /* _SQUID_COMPAT_H */