]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/compat.h
1 #ifndef _SQUID_COMPAT_H
2 #define _SQUID_COMPAT_H
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.
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
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.
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"
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
30 #define _XOPEN_SOURCE 1
32 #ifndef _XOPEN_SOURCE_EXTENDED
33 #define _XOPEN_SOURCE_EXTENDED 1
37 /*****************************************************/
38 /* FDSETSIZE is messy and needs to be done before */
39 /* sys/types.h are defined. */
40 /*****************************************************/
41 #include "compat/fdsetsize.h"
43 /*****************************************************/
44 /* Global type re-definitions */
45 /* this also takes care of the basic system includes */
46 /*****************************************************/
48 /** On linux this must be defined to get PRId64 and friends */
49 #define __STDC_FORMAT_MACROS
51 #include "compat/types.h"
53 /*****************************************************/
54 /* per-OS hacks. One file per OS. */
55 /* OS-macro wrapping should be done inside the OS .h */
56 /*****************************************************/
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/mswindows.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"
74 /*****************************************************/
75 /* portabilities shared between all platforms and */
76 /* components as found to be needed */
77 /*****************************************************/
79 #include "compat/assert.h"
80 #include "compat/compat_shared.h"
81 #include "compat/stdvarargs.h"
83 /* cstdio has a bunch of problems with 64-bit definitions */
84 #include "compat/stdio.h"
86 /*****************************************************/
87 /* component-specific portabilities */
88 /*****************************************************/
90 /* helper debugging requires some hacks to be clean */
91 #include "compat/debug.h"
93 /* Valgrind API macros changed between two versions squid supports */
94 #include "compat/valgrind.h"
96 /* Endian functions are usualy handled by the OS but not always. */
97 #include "squid_endian.h"
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.
104 #include "compat/GnuRegex.h"
106 /* some functions are unsafe to be used in Squid. */
107 #include "compat/unsafe.h"
109 /* cppunit is not quite C++0x compatible yet */
110 #include "compat/cppunit.h"
112 #endif /* _SQUID_COMPAT_H */