compat.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 separate 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 /* Solaris 10 has a broken definition for minor_t in IPFilter compat.
33  * We must pre-define before doing anything with OS headers so the OS
34  * do not. Then un-define it before using the IPFilter *_compat.h headers.
35  */
36 #if IPF_TRANSPARENT && USE_SOLARIS_IPFILTER_MINOR_T_HACK
37 /* But we only need do this nasty thing for src/ip/Intercept.cc */
38 #if BUILDING_SQUID_IP_INTERCEPT_CC
39 #define minor_t solaris_minor_t_fubar
40 #endif
41 #endif
42 
43 /*****************************************************/
44 /* FDSETSIZE is messy and needs to be done before */
45 /* sys/types.h are defined. */
46 /*****************************************************/
47 #include "compat/fdsetsize.h"
48 
49 /*****************************************************/
50 /* Global type re-definitions */
51 /* this also takes care of the basic system includes */
52 /*****************************************************/
53 
55 #define __STDC_FORMAT_MACROS
56 
57 #include "compat/types.h"
58 
59 /*****************************************************/
60 /* per-OS hacks. One file per OS. */
61 /* OS-macro wrapping should be done inside the OS .h */
62 /*****************************************************/
63 
64 #include "compat/os/aix.h"
65 #include "compat/os/android.h"
66 #include "compat/os/dragonfly.h"
67 #include "compat/os/freebsd.h"
68 #include "compat/os/hpux.h"
69 #include "compat/os/linux.h"
70 #include "compat/os/macosx.h"
71 #include "compat/os/mswindows.h"
72 #include "compat/os/netbsd.h"
73 #include "compat/os/next.h"
74 #include "compat/os/openbsd.h"
75 #include "compat/os/os2.h"
76 #include "compat/os/qnx.h"
77 #include "compat/os/sgi.h"
78 #include "compat/os/solaris.h"
79 #include "compat/os/sunos.h"
80 
81 /*****************************************************/
82 /* portabilities shared between all platforms and */
83 /* components as found to be needed */
84 /*****************************************************/
85 
86 #include "compat/assert.h"
87 #include "compat/compat_shared.h"
88 #include "compat/getaddrinfo.h"
89 #include "compat/getnameinfo.h"
90 #include "compat/inet_ntop.h"
91 #include "compat/inet_pton.h"
92 #include "compat/stdvarargs.h"
93 
94 /* cstdio has a bunch of problems with 64-bit definitions */
95 #include "compat/stdio.h"
96 
97 /* POSIX statvfs() is still not universal */
98 #include "compat/statvfs.h"
99 
100 /*****************************************************/
101 /* component-specific portabilities */
102 /*****************************************************/
103 
104 /* helper debugging requires some hacks to be clean */
105 #include "compat/debug.h"
106 
107 /* Valgrind API macros changed between two versions squid supports */
108 #include "compat/valgrind.h"
109 
115 #include "compat/GnuRegex.h"
116 
117 /* cppunit is not quite C++0x compatible yet */
118 #include "compat/cppunit.h"
119 
120 #endif /* _SQUID_COMPAT_H */
121 

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors