]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/compat.h
C++11: Remove GnuRegex and all -lregex related code
[thirdparty/squid.git] / compat / compat.h
1 /*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef _SQUID_COMPAT_H
10 #define _SQUID_COMPAT_H
11
12 /*
13 * From discussions it was chosen to push compat code as far down as possible.
14 * That means we can have a seperate compat for most
15 * compatability and portability hacks and resolutions.
16 *
17 * This file is meant to collate all those hacks files together and
18 * provide a simple include for them in the core squid headers
19 * (presently squid.h)
20 *
21 * It should not be included directly in any of the squid sources.
22 * If your code requires any symbols from here you should be importing
23 * squid.h at the top line of your .cc file.
24 */
25
26 /******************************************************/
27 /* Define the _SQUID_TYPE_ based on a guess of the OS */
28 /* NP: this MUST come first within compat.h */
29 /******************************************************/
30 #include "compat/osdetect.h"
31
32 /* ugly hack. But we need to set this REALLY soon in the header */
33 #if _SQUID_SOLARIS_ && !defined(__GNUC__) && !defined(__GNUG__)
34 #ifndef __EXTENSIONS__
35 #define __EXTENSIONS__ 1
36 #endif
37 #ifndef _XOPEN_SOURCE
38 #define _XOPEN_SOURCE 1
39 #endif
40 #ifndef _XOPEN_SOURCE_EXTENDED
41 #define _XOPEN_SOURCE_EXTENDED 1
42 #endif
43 #endif
44
45 /* Solaris 10 has a broken definition for minor_t in IPFilter compat.
46 * We must pre-define before doing anything with OS headers so the OS
47 * do not. Then un-define it before using the IPFilter *_compat.h headers.
48 */
49 #if IPF_TRANSPARENT && USE_SOLARIS_IPFILTER_MINOR_T_HACK
50 /* But we only need do this nasty thing for src/ip/Intercept.cc */
51 #if BUILDING_SQUID_IP_INTERCEPT_CC
52 #define minor_t solaris_minor_t_fubar
53 #endif
54 #endif
55
56 /*****************************************************/
57 /* FDSETSIZE is messy and needs to be done before */
58 /* sys/types.h are defined. */
59 /*****************************************************/
60 #include "compat/fdsetsize.h"
61
62 /*****************************************************/
63 /* Global type re-definitions */
64 /* this also takes care of the basic system includes */
65 /*****************************************************/
66
67 /** On linux this must be defined to get PRId64 and friends */
68 #define __STDC_FORMAT_MACROS
69
70 #include "compat/types.h"
71
72 /*****************************************************/
73 /* per-OS hacks. One file per OS. */
74 /* OS-macro wrapping should be done inside the OS .h */
75 /*****************************************************/
76
77 #include "compat/os/aix.h"
78 #include "compat/os/android.h"
79 #include "compat/os/dragonfly.h"
80 #include "compat/os/freebsd.h"
81 #include "compat/os/hpux.h"
82 #include "compat/os/linux.h"
83 #include "compat/os/macosx.h"
84 #include "compat/os/mswindows.h"
85 #include "compat/os/netbsd.h"
86 #include "compat/os/next.h"
87 #include "compat/os/openbsd.h"
88 #include "compat/os/os2.h"
89 #include "compat/os/qnx.h"
90 #include "compat/os/sgi.h"
91 #include "compat/os/solaris.h"
92 #include "compat/os/sunos.h"
93
94 /*****************************************************/
95 /* portabilities shared between all platforms and */
96 /* components as found to be needed */
97 /*****************************************************/
98
99 #include "compat/assert.h"
100 #include "compat/compat_shared.h"
101 #include "compat/getaddrinfo.h"
102 #include "compat/getnameinfo.h"
103 #include "compat/inet_ntop.h"
104 #include "compat/inet_pton.h"
105 #include "compat/stdvarargs.h"
106
107 /* cstdio has a bunch of problems with 64-bit definitions */
108 #include "compat/stdio.h"
109
110 /* POSIX statvfs() is still not universal */
111 #include "compat/statvfs.h"
112
113 /*****************************************************/
114 /* component-specific portabilities */
115 /*****************************************************/
116
117 /* helper debugging requires some hacks to be clean */
118 #include "compat/debug.h"
119
120 /* Valgrind API macros changed between two versions squid supports */
121 #include "compat/valgrind.h"
122
123 /* cppunit is not quite C++0x compatible yet */
124 #include "compat/cppunit.h"
125
126 #endif /* _SQUID_COMPAT_H */
127