]> git.ipfire.org Git - thirdparty/squid.git/blame - include/config.h
Merge from trunk
[thirdparty/squid.git] / include / config.h
CommitLineData
4d683a65 1/*
f04e1182 2 * $Id$
4d683a65 3 *
4 * AUTHOR: Duane Wessels
5 *
6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
8 *
9 * Squid is the result of efforts by numerous individuals from
10 * the Internet community; see the CONTRIBUTORS file for full
11 * details. Many organizations have provided support for Squid's
12 * development; see the SPONSORS file for full details. Squid is
13 * Copyrighted (C) 2001 by the Regents of the University of
14 * California; see the COPYRIGHT file for full details. Squid
15 * incorporates software developed and/or copyrighted by other
16 * sources; see the CREDITS file for full details.
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
c5dd4956 22 *
4d683a65 23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
c5dd4956 27 *
4d683a65 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
c5dd4956 31 *
4d683a65 32 */
33
b5638623 34#ifndef SQUID_CONFIG_H
35#define SQUID_CONFIG_H
4d683a65 36
392bbafe 37#include "autoconf.h" /* For GNU autoconf variables */
d1f95b42
AJ
38
39#if !defined(HAVE_SQUID)
40/* sub-packages define their own version details */
4d683a65 41#include "version.h"
42
d1f95b42
AJ
43#endif
44
e6ccf245 45/* To keep API definitions clear */
46#ifdef __cplusplus
47#define SQUIDCEXTERN extern "C"
48#else
49#define SQUIDCEXTERN extern
50#endif
51
4d683a65 52/****************************************************************************
53 *--------------------------------------------------------------------------*
54 * DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
55 *--------------------------------------------------------------------------*
56 ****************************************************************************/
57
2b58ea68 58#include "squid-compat/compat.h"
f04e1182 59
4d683a65 60#ifdef USE_POSIX_REGEX
61#ifndef USE_RE_SYNTAX
62#define USE_RE_SYNTAX REG_EXTENDED /* default Syntax */
63#endif
64#endif
65
6a9f6389 66
67/* Typedefs for missing entries on a system */
68
0409a509 69/* int8_t */
70#ifndef HAVE_INT8_T
71#if HAVE_CHAR && SIZEOF_CHAR == 1
72typedef char int8_t;
73#else
74#error NO 8 bit signed type available
75#endif
76#endif
77
78/* u_int8_t */
79#ifndef HAVE_U_INT8_T
80#if HAVE_UINT8_T
81typedef uint8_t u_int8_t;
82#else
83typedef unsigned char u_int8_t;
84#endif
85#endif
86
6a9f6389 87/* int16_t */
88#ifndef HAVE_INT16_T
89#if HAVE_SHORT && SIZEOF_SHORT == 2
90typedef short int16_t;
91#elif HAVE_INT && SIZEOF_INT == 2
92typedef int int16_t;
93#else
94#error NO 16 bit signed type available
95#endif
96#endif
97
98/* u_int16_t */
99#ifndef HAVE_U_INT16_T
100#if HAVE_UINT16_T
101typedef uint16_t u_int16_t;
102#else
103typedef unsigned int16_t u_int16_t;
104#endif
105#endif
106
107/* int32_t */
108#ifndef HAVE_INT32_T
109#if HAVE_INT && SIZEOF_INT == 4
110typedef int int32_t;
111#elif HAVE_LONG && SIZEOF_LONG == 4
112typedef long int32_t;
113#else
114#error NO 32 bit signed type available
115#endif
116#endif
117
118/* u_int32_t */
119#ifndef HAVE_U_INT32_T
120#if HAVE_UINT32_T
121typedef uint32_t u_int32_t;
122#else
123typedef unsigned int32_t u_int32_t;
124#endif
125#endif
126
127/* int64_t */
128#ifndef HAVE_INT64_T
129#if HAVE___INT64
130typedef __int64 int64_t;
131#elif HAVE_LONG && SIZEOF_LONG == 8
132typedef long int64_t;
133#elif HAVE_LONG_LONG && SIZEOF_LONG_LONG == 8
134typedef long long int64_t;
135#else
136#error NO 64 bit signed type available
137#endif
138#endif
139
140/* u_int64_t */
141#ifndef HAVE_U_INT64_T
142#if HAVE_UINT64_T
143typedef uint64_t u_int64_t;
144#else
145typedef unsigned int64_t u_int64_t;
4d683a65 146#endif
147#endif
148
6a9f6389 149
150#ifndef HAVE_PID_T
151typedef int pid_t;
152#endif
153
154#ifndef HAVE_SIZE_T
155typedef unsigned int size_t;
156#endif
157
158#ifndef HAVE_SSIZE_T
159typedef int ssize_t;
160#endif
161
162#ifndef HAVE_OFF_T
163typedef int off_t;
164#endif
165
166#ifndef HAVE_MODE_T
167typedef unsigned short mode_t;
168#endif
169
170#ifndef HAVE_FD_MASK
171typedef unsigned long fd_mask;
172#endif
173
174#ifndef HAVE_SOCKLEN_T
175typedef int socklen_t;
176#endif
177
178#ifndef HAVE_MTYP_T
179typedef long mtyp_t;
180#endif
181
4d683a65 182#if !defined(CACHEMGR_HOSTNAME)
183#define CACHEMGR_HOSTNAME ""
42ad37af 184#else
185#define CACHEMGR_HOSTNAME_DEFINED 1
4d683a65 186#endif
187
6a9f6389 188#if SQUID_DETECT_UDP_SO_SNDBUF > 16384
4d683a65 189#define SQUID_UDP_SO_SNDBUF 16384
6a9f6389 190#else
191#define SQUID_UDP_SO_SNDBUF SQUID_DETECT_UDP_SO_SNDBUF
4d683a65 192#endif
193
6a9f6389 194#if SQUID_DETECT_UDP_SO_RCVBUF > 16384
4d683a65 195#define SQUID_UDP_SO_RCVBUF 16384
6a9f6389 196#else
197#define SQUID_UDP_SO_RCVBUF SQUID_DETECT_UDP_SO_RCVBUF
4d683a65 198#endif
199
200#ifdef HAVE_MEMCPY
201#define xmemcpy(d,s,n) memcpy((d),(s),(n))
202#elif HAVE_BCOPY
203#define xmemcpy(d,s,n) bcopy((s),(d),(n))
204#elif HAVE_MEMMOVE
205#define xmemcpy(d,s,n) memmove((d),(s),(n))
206#endif
207
208#ifdef HAVE_MEMMOVE
209#define xmemmove(d,s,n) memmove((d),(s),(n))
210#elif HAVE_BCOPY
211#define xmemmove(d,s,n) bcopy((s),(d),(n))
212#endif
213
214#define xisspace(x) isspace((unsigned char)x)
215#define xtoupper(x) toupper((unsigned char)x)
216#define xtolower(x) tolower((unsigned char)x)
217#define xisdigit(x) isdigit((unsigned char)x)
218#define xisascii(x) isascii((unsigned char)x)
219#define xislower(x) islower((unsigned char)x)
220#define xisalpha(x) isalpha((unsigned char)x)
ec451a0f 221#define xisprint(x) isprint((unsigned char)x)
222#define xisalnum(x) isalnum((unsigned char)x)
223#define xiscntrl(x) iscntrl((unsigned char)x)
224#define xispunct(x) ispunct((unsigned char)x)
225#define xisupper(x) isupper((unsigned char)x)
226#define xisxdigit(x) isxdigit((unsigned char)x)
ba53f4b8 227#define xisgraph(x) isgraph((unsigned char)x)
4d683a65 228
229#if HAVE_RANDOM
230#define squid_random random
231#define squid_srandom srandom
232#elif HAVE_LRAND48
233#define squid_random lrand48
234#define squid_srandom srand48
235#else
236#define squid_random rand
237#define squid_srandom srand
238#endif
239
798f959e 240/* gcc doesn't recognize the Windows native 64 bit formatting tags causing
241 * the compile fail, so we must disable the check on native Windows.
c5dd4956 242 */
798f959e 243
244#if __GNUC__ && !defined(_SQUID_MSWIN_)
68361fc4 245#define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2)))
246#define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3)))
247#define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4)))
392bbafe 248#else
68361fc4 249#define PRINTF_FORMAT_ARG1
250#define PRINTF_FORMAT_ARG2
251#define PRINTF_FORMAT_ARG3
392bbafe 252#endif
253
b4bab919 254/*
255 * Determine if this is a leak check build or standard
256 */
257#if PURIFY
258#define LEAK_CHECK_MODE 1
259#elif WITH_VALGRIND
260#define LEAK_CHECK_MODE 1
261#elif XMALLOC_TRACE
262#define LEAK_CHECK_MODE 1
263#endif
264
cee08cbc
AJ
265
266/*
267 * strnstr() is needed. The OS may not provide a working copy.
268 */
269#include "strnstr.h"
270
b5638623 271#endif /* SQUID_CONFIG_H */