]> git.ipfire.org Git - thirdparty/squid.git/blame - compat/compat.h
SourceFormat Enforcement
[thirdparty/squid.git] / compat / compat.h
CommitLineData
37be9888 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
37be9888
AJ
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
f04e1182
AJ
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.
eee95dfe 14 * That means we can have a seperate compat for most
f04e1182 15 * compatability and portability hacks and resolutions.
af6a12ee 16 *
f04e1182 17 * This file is meant to collate all those hacks files together and
5cf3b000 18 * provide a simple include for them in the core squid headers
0baa07cd 19 * (presently squid.h)
f04e1182
AJ
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
42502168 23 * squid.h at the top line of your .cc file.
f04e1182
AJ
24 */
25
f04e1182
AJ
26/******************************************************/
27/* Define the _SQUID_TYPE_ based on a guess of the OS */
28/* NP: this MUST come first within compat.h */
29/******************************************************/
eee95dfe 30#include "compat/osdetect.h"
f04e1182 31
d25bbe26
AJ
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
f04e1182
AJ
43/*****************************************************/
44/* FDSETSIZE is messy and needs to be done before */
45/* sys/types.h are defined. */
46/*****************************************************/
eee95dfe 47#include "compat/fdsetsize.h"
f04e1182 48
f04e1182
AJ
49/*****************************************************/
50/* Global type re-definitions */
51/* this also takes care of the basic system includes */
52/*****************************************************/
53
54/** On linux this must be defined to get PRId64 and friends */
55#define __STDC_FORMAT_MACROS
56
489520a9 57#include "compat/types.h"
f04e1182
AJ
58
59/*****************************************************/
60/* per-OS hacks. One file per OS. */
61/* OS-macro wrapping should be done inside the OS .h */
62/*****************************************************/
63
eee95dfe 64#include "compat/os/aix.h"
6b7b32cd 65#include "compat/os/android.h"
eee95dfe
AJ
66#include "compat/os/dragonfly.h"
67#include "compat/os/freebsd.h"
68#include "compat/os/hpux.h"
69#include "compat/os/linux.h"
055421ee 70#include "compat/os/macosx.h"
94fa5008 71#include "compat/os/mswindows.h"
dc47f531 72#include "compat/os/netbsd.h"
eee95dfe
AJ
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"
dc7b4068 78#include "compat/os/solaris.h"
eee95dfe 79#include "compat/os/sunos.h"
f04e1182
AJ
80
81/*****************************************************/
82/* portabilities shared between all platforms and */
83/* components as found to be needed */
84/*****************************************************/
85
602d9612 86#include "compat/assert.h"
eee95dfe 87#include "compat/compat_shared.h"
55d7d5e9
AJ
88#include "compat/getaddrinfo.h"
89#include "compat/getnameinfo.h"
90#include "compat/inet_ntop.h"
91#include "compat/inet_pton.h"
eee95dfe 92#include "compat/stdvarargs.h"
f04e1182 93
5b44c55d
FC
94/* cstdio has a bunch of problems with 64-bit definitions */
95#include "compat/stdio.h"
96
615540cd
AJ
97/* POSIX statvfs() is still not universal */
98#include "compat/statvfs.h"
99
f04e1182
AJ
100/*****************************************************/
101/* component-specific portabilities */
102/*****************************************************/
103
fdbb3b19 104/* helper debugging requires some hacks to be clean */
c19c2c0b 105#include "compat/debug.h"
fdbb3b19 106
f04e1182 107/* Valgrind API macros changed between two versions squid supports */
eee95dfe 108#include "compat/valgrind.h"
f04e1182 109
c2afddd8
AJ
110/**
111 * A Regular Expression library is bundled with Squid.
112 * Default is to use a system provided one, but the bundle
113 * may be used instead with explicit configuration.
114 */
115#include "compat/GnuRegex.h"
116
a203dec7
AJ
117/* cppunit is not quite C++0x compatible yet */
118#include "compat/cppunit.h"
119
f04e1182 120#endif /* _SQUID_COMPAT_H */
f53969cc 121