]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/compat.h
Windows: fix getaddrinfo, getnameinfo, inet_ntop and inet_pton detection
[thirdparty/squid.git] / compat / compat.h
1 /*
2 * Copyright (C) 1996-2014 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 /*****************************************************/
46 /* FDSETSIZE is messy and needs to be done before */
47 /* sys/types.h are defined. */
48 /*****************************************************/
49 #include "compat/fdsetsize.h"
50
51 /*****************************************************/
52 /* Global type re-definitions */
53 /* this also takes care of the basic system includes */
54 /*****************************************************/
55
56 /** On linux this must be defined to get PRId64 and friends */
57 #define __STDC_FORMAT_MACROS
58
59 #include "compat/types.h"
60
61 /*****************************************************/
62 /* per-OS hacks. One file per OS. */
63 /* OS-macro wrapping should be done inside the OS .h */
64 /*****************************************************/
65
66 #include "compat/os/aix.h"
67 #include "compat/os/android.h"
68 #include "compat/os/dragonfly.h"
69 #include "compat/os/freebsd.h"
70 #include "compat/os/hpux.h"
71 #include "compat/os/linux.h"
72 #include "compat/os/macosx.h"
73 #include "compat/os/mswindows.h"
74 #include "compat/os/netbsd.h"
75 #include "compat/os/next.h"
76 #include "compat/os/openbsd.h"
77 #include "compat/os/os2.h"
78 #include "compat/os/qnx.h"
79 #include "compat/os/sgi.h"
80 #include "compat/os/solaris.h"
81 #include "compat/os/sunos.h"
82
83 /*****************************************************/
84 /* portabilities shared between all platforms and */
85 /* components as found to be needed */
86 /*****************************************************/
87
88 #include "compat/assert.h"
89 #include "compat/compat_shared.h"
90 #include "compat/getaddrinfo.h"
91 #include "compat/getnameinfo.h"
92 #include "compat/inet_ntop.h"
93 #include "compat/inet_pton.h"
94 #include "compat/stdvarargs.h"
95
96 /* cstdio has a bunch of problems with 64-bit definitions */
97 #include "compat/stdio.h"
98
99 /* POSIX statvfs() is still not universal */
100 #include "compat/statvfs.h"
101
102 /*****************************************************/
103 /* component-specific portabilities */
104 /*****************************************************/
105
106 /* helper debugging requires some hacks to be clean */
107 #include "compat/debug.h"
108
109 /* Valgrind API macros changed between two versions squid supports */
110 #include "compat/valgrind.h"
111
112 /**
113 * A Regular Expression library is bundled with Squid.
114 * Default is to use a system provided one, but the bundle
115 * may be used instead with explicit configuration.
116 */
117 #include "compat/GnuRegex.h"
118
119 /* cppunit is not quite C++0x compatible yet */
120 #include "compat/cppunit.h"
121
122 #endif /* _SQUID_COMPAT_H */
123