]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/compat.h
5 #ifndef _SQUID_COMPAT_H
6 #define _SQUID_COMPAT_H
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.
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)
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.
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"
29 /* ugly hack. But we need to set this REALLY soon in the header */
30 #if _SQUID_SOLARIS_ && !defined(__GNUC__) && !defined(__GNUG__)
31 #ifndef __EXTENSIONS__
32 #define __EXTENSIONS__ 1
35 #define _XOPEN_SOURCE 1
37 #ifndef _XOPEN_SOURCE_EXTENDED
38 #define _XOPEN_SOURCE_EXTENDED 1
44 /*****************************************************/
45 /* FDSETSIZE is messy and needs to be done before */
46 /* sys/types.h are defined. */
47 /*****************************************************/
48 #include "compat/fdsetsize.h"
51 /*****************************************************/
52 /* Global type re-definitions */
53 /* this also takes care of the basic system includes */
54 /*****************************************************/
56 /** On linux this must be defined to get PRId64 and friends */
57 #define __STDC_FORMAT_MACROS
59 #include "compat/types.h"
61 /*****************************************************/
62 /* per-OS hacks. One file per OS. */
63 /* OS-macro wrapping should be done inside the OS .h */
64 /*****************************************************/
66 #include "compat/os/aix.h"
67 #include "compat/os/dragonfly.h"
68 #include "compat/os/freebsd.h"
69 #include "compat/os/hpux.h"
70 #include "compat/os/linux.h"
71 #include "compat/os/macosx.h"
72 #include "compat/os/mswin.h"
73 #include "compat/os/netbsd.h"
74 #include "compat/os/next.h"
75 #include "compat/os/openbsd.h"
76 #include "compat/os/os2.h"
77 #include "compat/os/qnx.h"
78 #include "compat/os/sgi.h"
79 #include "compat/os/solaris.h"
80 #include "compat/os/sunos.h"
81 #include "compat/os/windows.h"
84 /*****************************************************/
85 /* portabilities shared between all platforms and */
86 /* components as found to be needed */
87 /*****************************************************/
89 #include "compat/compat_shared.h"
90 #include "compat/stdvarargs.h"
91 #include "compat/assert.h"
94 /*****************************************************/
95 /* component-specific portabilities */
96 /*****************************************************/
98 /* helper debugging requires some hacks to be clean */
99 #include "compat/debug.h"
101 /* Valgrind API macros changed between two versions squid supports */
102 #include "compat/valgrind.h"
104 /* Endian functions are usualy handled by the OS but not always. */
105 #include "squid_endian.h"
108 * A Regular Expression library is bundled with Squid.
109 * Default is to use a system provided one, but the bundle
110 * may be used instead with explicit configuration.
112 #include "compat/GnuRegex.h"
114 /* some functions are unsafe to be used in Squid. */
115 #include "compat/unsafe.h"
117 #endif /* _SQUID_COMPAT_H */