]>
Commit | Line | Data |
---|---|---|
f04e1182 AJ |
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. | |
eee95dfe | 6 | * That means we can have a seperate compat for most |
f04e1182 | 7 | * compatability and portability hacks and resolutions. |
af6a12ee | 8 | * |
f04e1182 | 9 | * This file is meant to collate all those hacks files together and |
5cf3b000 | 10 | * provide a simple include for them in the core squid headers |
0baa07cd | 11 | * (presently squid.h) |
f04e1182 AJ |
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 | |
42502168 | 15 | * squid.h at the top line of your .cc file. |
f04e1182 AJ |
16 | */ |
17 | ||
f04e1182 AJ |
18 | /******************************************************/ |
19 | /* Define the _SQUID_TYPE_ based on a guess of the OS */ | |
20 | /* NP: this MUST come first within compat.h */ | |
21 | /******************************************************/ | |
eee95dfe | 22 | #include "compat/osdetect.h" |
f04e1182 | 23 | |
cdb86165 | 24 | /* ugly hack. But we need to set this REALLY soon in the header */ |
a05af879 FC |
25 | #if _SQUID_SOLARIS_ && !defined(__GNUC__) && !defined(__GNUG__) |
26 | #ifndef __EXTENSIONS__ | |
27 | #define __EXTENSIONS__ 1 | |
28 | #endif | |
cdb86165 FC |
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 | ||
f04e1182 AJ |
37 | /*****************************************************/ |
38 | /* FDSETSIZE is messy and needs to be done before */ | |
39 | /* sys/types.h are defined. */ | |
40 | /*****************************************************/ | |
eee95dfe | 41 | #include "compat/fdsetsize.h" |
f04e1182 | 42 | |
f04e1182 AJ |
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 | ||
489520a9 | 51 | #include "compat/types.h" |
f04e1182 AJ |
52 | |
53 | /*****************************************************/ | |
54 | /* per-OS hacks. One file per OS. */ | |
55 | /* OS-macro wrapping should be done inside the OS .h */ | |
56 | /*****************************************************/ | |
57 | ||
eee95dfe AJ |
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" | |
055421ee | 63 | #include "compat/os/macosx.h" |
eee95dfe | 64 | #include "compat/os/mswin.h" |
dc47f531 | 65 | #include "compat/os/netbsd.h" |
eee95dfe AJ |
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" | |
dc7b4068 | 71 | #include "compat/os/solaris.h" |
eee95dfe AJ |
72 | #include "compat/os/sunos.h" |
73 | #include "compat/os/windows.h" | |
f04e1182 AJ |
74 | |
75 | /*****************************************************/ | |
76 | /* portabilities shared between all platforms and */ | |
77 | /* components as found to be needed */ | |
78 | /*****************************************************/ | |
79 | ||
eee95dfe AJ |
80 | #include "compat/compat_shared.h" |
81 | #include "compat/stdvarargs.h" | |
82 | #include "compat/assert.h" | |
f04e1182 | 83 | |
5b44c55d FC |
84 | /* cstdio has a bunch of problems with 64-bit definitions */ |
85 | #include "compat/stdio.h" | |
86 | ||
f04e1182 AJ |
87 | /*****************************************************/ |
88 | /* component-specific portabilities */ | |
89 | /*****************************************************/ | |
90 | ||
fdbb3b19 | 91 | /* helper debugging requires some hacks to be clean */ |
c19c2c0b | 92 | #include "compat/debug.h" |
fdbb3b19 | 93 | |
f04e1182 | 94 | /* Valgrind API macros changed between two versions squid supports */ |
eee95dfe | 95 | #include "compat/valgrind.h" |
f04e1182 AJ |
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 | */ | |
eee95dfe | 105 | #include "compat/GnuRegex.h" |
f04e1182 | 106 | |
dc47f531 AJ |
107 | /* some functions are unsafe to be used in Squid. */ |
108 | #include "compat/unsafe.h" | |
f04e1182 | 109 | |
a203dec7 AJ |
110 | /* cppunit is not quite C++0x compatible yet */ |
111 | #include "compat/cppunit.h" | |
112 | ||
f04e1182 | 113 | #endif /* _SQUID_COMPAT_H */ |