]> git.ipfire.org Git - thirdparty/squid.git/blame - compat/compat.h
SourceFormat Enforcement
[thirdparty/squid.git] / compat / compat.h
CommitLineData
f04e1182
AJ
1#ifndef _SQUID_COMPAT_H
2#define _SQUID_COMPAT_H
3
4/*
5 * From discussions it was chosen to push compat code as far down as possible.
eee95dfe 6 * That means we can have a seperate compat for most
f04e1182 7 * compatability and portability hacks and resolutions.
af6a12ee 8 *
f04e1182 9 * This file is meant to collate all those hacks files together and
5cf3b000 10 * provide a simple include for them in the core squid headers
0baa07cd 11 * (presently squid.h)
f04e1182
AJ
12 *
13 * It should not be included directly in any of the squid sources.
14 * If your code requires any symbols from here you should be importing
42502168 15 * squid.h at the top line of your .cc file.
f04e1182
AJ
16 */
17
f04e1182
AJ
18/******************************************************/
19/* Define the _SQUID_TYPE_ based on a guess of the OS */
20/* NP: this MUST come first within compat.h */
21/******************************************************/
eee95dfe 22#include "compat/osdetect.h"
f04e1182 23
cdb86165 24/* ugly hack. But we need to set this REALLY soon in the header */
a05af879
FC
25#if _SQUID_SOLARIS_ && !defined(__GNUC__) && !defined(__GNUG__)
26#ifndef __EXTENSIONS__
27#define __EXTENSIONS__ 1
28#endif
cdb86165
FC
29#ifndef _XOPEN_SOURCE
30#define _XOPEN_SOURCE 1
31#endif
32#ifndef _XOPEN_SOURCE_EXTENDED
33#define _XOPEN_SOURCE_EXTENDED 1
34#endif
35#endif
36
f04e1182
AJ
37/*****************************************************/
38/* FDSETSIZE is messy and needs to be done before */
39/* sys/types.h are defined. */
40/*****************************************************/
eee95dfe 41#include "compat/fdsetsize.h"
f04e1182 42
f04e1182
AJ
43/*****************************************************/
44/* Global type re-definitions */
45/* this also takes care of the basic system includes */
46/*****************************************************/
47
48/** On linux this must be defined to get PRId64 and friends */
49#define __STDC_FORMAT_MACROS
50
489520a9 51#include "compat/types.h"
f04e1182
AJ
52
53/*****************************************************/
54/* per-OS hacks. One file per OS. */
55/* OS-macro wrapping should be done inside the OS .h */
56/*****************************************************/
57
eee95dfe
AJ
58#include "compat/os/aix.h"
59#include "compat/os/dragonfly.h"
60#include "compat/os/freebsd.h"
61#include "compat/os/hpux.h"
62#include "compat/os/linux.h"
055421ee 63#include "compat/os/macosx.h"
94fa5008 64#include "compat/os/mswindows.h"
dc47f531 65#include "compat/os/netbsd.h"
eee95dfe
AJ
66#include "compat/os/next.h"
67#include "compat/os/openbsd.h"
68#include "compat/os/os2.h"
69#include "compat/os/qnx.h"
70#include "compat/os/sgi.h"
dc7b4068 71#include "compat/os/solaris.h"
eee95dfe 72#include "compat/os/sunos.h"
f04e1182
AJ
73
74/*****************************************************/
75/* portabilities shared between all platforms and */
76/* components as found to be needed */
77/*****************************************************/
78
602d9612 79#include "compat/assert.h"
eee95dfe
AJ
80#include "compat/compat_shared.h"
81#include "compat/stdvarargs.h"
f04e1182 82
5b44c55d
FC
83/* cstdio has a bunch of problems with 64-bit definitions */
84#include "compat/stdio.h"
85
f04e1182
AJ
86/*****************************************************/
87/* component-specific portabilities */
88/*****************************************************/
89
fdbb3b19 90/* helper debugging requires some hacks to be clean */
c19c2c0b 91#include "compat/debug.h"
fdbb3b19 92
f04e1182 93/* Valgrind API macros changed between two versions squid supports */
eee95dfe 94#include "compat/valgrind.h"
f04e1182
AJ
95
96/* Endian functions are usualy handled by the OS but not always. */
97#include "squid_endian.h"
98
99/**
100 * A Regular Expression library is bundled with Squid.
101 * Default is to use a system provided one, but the bundle
102 * may be used instead with explicit configuration.
103 */
eee95dfe 104#include "compat/GnuRegex.h"
f04e1182 105
dc47f531
AJ
106/* some functions are unsafe to be used in Squid. */
107#include "compat/unsafe.h"
f04e1182 108
a203dec7
AJ
109/* cppunit is not quite C++0x compatible yet */
110#include "compat/cppunit.h"
111
f04e1182 112#endif /* _SQUID_COMPAT_H */