compat.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 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 * compatibility 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/openbsd.h"
74#include "compat/os/os2.h"
75#include "compat/os/qnx.h"
76#include "compat/os/sgi.h"
77#include "compat/os/solaris.h"
78#include "compat/os/sunos.h"
79
80/*****************************************************/
81/* portabilities shared between all platforms and */
82/* components as found to be needed */
83/*****************************************************/
84
85#include "compat/assert.h"
87#include "compat/getaddrinfo.h"
88#include "compat/getnameinfo.h"
89#include "compat/inet_ntop.h"
90#include "compat/inet_pton.h"
91#include "compat/stdvarargs.h"
92
93/* cstdio has a bunch of problems with 64-bit definitions */
94#include "compat/stdio.h"
95
96/* POSIX statvfs() is still not universal */
97#include "compat/statvfs.h"
98
99/*****************************************************/
100/* component-specific portabilities */
101/*****************************************************/
102
103/* helper debugging requires some hacks to be clean */
104#include "compat/debug.h"
105
106/* Valgrind API macros changed between two versions squid supports */
107#include "compat/valgrind.h"
108
114#include "compat/GnuRegex.h"
115
116#endif /* _SQUID_COMPAT_H */
117

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors