]> git.ipfire.org Git - thirdparty/squid.git/blame - compat/compat.h
Polish peek-and-splice related code part2
[thirdparty/squid.git] / compat / compat.h
CommitLineData
37be9888
AJ
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
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
cdb86165 32/* ugly hack. But we need to set this REALLY soon in the header */
a05af879
FC
33#if _SQUID_SOLARIS_ && !defined(__GNUC__) && !defined(__GNUG__)
34#ifndef __EXTENSIONS__
35#define __EXTENSIONS__ 1
36#endif
cdb86165
FC
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
f04e1182
AJ
45/*****************************************************/
46/* FDSETSIZE is messy and needs to be done before */
47/* sys/types.h are defined. */
48/*****************************************************/
eee95dfe 49#include "compat/fdsetsize.h"
f04e1182 50
f04e1182
AJ
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
489520a9 59#include "compat/types.h"
f04e1182
AJ
60
61/*****************************************************/
62/* per-OS hacks. One file per OS. */
63/* OS-macro wrapping should be done inside the OS .h */
64/*****************************************************/
65
eee95dfe 66#include "compat/os/aix.h"
6b7b32cd 67#include "compat/os/android.h"
eee95dfe
AJ
68#include "compat/os/dragonfly.h"
69#include "compat/os/freebsd.h"
70#include "compat/os/hpux.h"
71#include "compat/os/linux.h"
055421ee 72#include "compat/os/macosx.h"
94fa5008 73#include "compat/os/mswindows.h"
dc47f531 74#include "compat/os/netbsd.h"
eee95dfe
AJ
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"
dc7b4068 80#include "compat/os/solaris.h"
eee95dfe 81#include "compat/os/sunos.h"
f04e1182
AJ
82
83/*****************************************************/
84/* portabilities shared between all platforms and */
85/* components as found to be needed */
86/*****************************************************/
87
602d9612 88#include "compat/assert.h"
eee95dfe
AJ
89#include "compat/compat_shared.h"
90#include "compat/stdvarargs.h"
f04e1182 91
5b44c55d
FC
92/* cstdio has a bunch of problems with 64-bit definitions */
93#include "compat/stdio.h"
94
f04e1182
AJ
95/*****************************************************/
96/* component-specific portabilities */
97/*****************************************************/
98
fdbb3b19 99/* helper debugging requires some hacks to be clean */
c19c2c0b 100#include "compat/debug.h"
fdbb3b19 101
f04e1182 102/* Valgrind API macros changed between two versions squid supports */
eee95dfe 103#include "compat/valgrind.h"
f04e1182
AJ
104
105/* Endian functions are usualy handled by the OS but not always. */
106#include "squid_endian.h"
107
108/**
109 * A Regular Expression library is bundled with Squid.
110 * Default is to use a system provided one, but the bundle
111 * may be used instead with explicit configuration.
112 */
eee95dfe 113#include "compat/GnuRegex.h"
f04e1182 114
a203dec7
AJ
115/* cppunit is not quite C++0x compatible yet */
116#include "compat/cppunit.h"
117
f04e1182 118#endif /* _SQUID_COMPAT_H */