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