]> git.ipfire.org Git - thirdparty/squid.git/blame - include/config.h
Push-merge
[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
73862432
FC
52#if _USE_INLINE_
53#define _SQUID_INLINE_ inline
54#else
55#define _SQUID_INLINE_
56#endif
57
4d683a65 58/****************************************************************************
59 *--------------------------------------------------------------------------*
60 * DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
61 *--------------------------------------------------------------------------*
62 ****************************************************************************/
63
eee95dfe 64#include "compat/compat.h"
f04e1182 65
4d683a65 66#ifdef USE_POSIX_REGEX
67#ifndef USE_RE_SYNTAX
68#define USE_RE_SYNTAX REG_EXTENDED /* default Syntax */
69#endif
70#endif
71
4d683a65 72#if !defined(CACHEMGR_HOSTNAME)
73#define CACHEMGR_HOSTNAME ""
42ad37af 74#else
75#define CACHEMGR_HOSTNAME_DEFINED 1
4d683a65 76#endif
77
6a9f6389 78#if SQUID_DETECT_UDP_SO_SNDBUF > 16384
4d683a65 79#define SQUID_UDP_SO_SNDBUF 16384
6a9f6389 80#else
81#define SQUID_UDP_SO_SNDBUF SQUID_DETECT_UDP_SO_SNDBUF
4d683a65 82#endif
83
6a9f6389 84#if SQUID_DETECT_UDP_SO_RCVBUF > 16384
4d683a65 85#define SQUID_UDP_SO_RCVBUF 16384
6a9f6389 86#else
87#define SQUID_UDP_SO_RCVBUF SQUID_DETECT_UDP_SO_RCVBUF
4d683a65 88#endif
89
32d002cb 90#if HAVE_MEMCPY
4d683a65 91#define xmemcpy(d,s,n) memcpy((d),(s),(n))
92#elif HAVE_BCOPY
93#define xmemcpy(d,s,n) bcopy((s),(d),(n))
94#elif HAVE_MEMMOVE
95#define xmemcpy(d,s,n) memmove((d),(s),(n))
96#endif
97
32d002cb 98#if HAVE_MEMMOVE
4d683a65 99#define xmemmove(d,s,n) memmove((d),(s),(n))
100#elif HAVE_BCOPY
101#define xmemmove(d,s,n) bcopy((s),(d),(n))
102#endif
103
75aa769b
AJ
104#if HAVE_CTYPE_H
105#include <ctype.h>
106#endif
4d683a65 107#define xisspace(x) isspace((unsigned char)x)
108#define xtoupper(x) toupper((unsigned char)x)
109#define xtolower(x) tolower((unsigned char)x)
110#define xisdigit(x) isdigit((unsigned char)x)
111#define xisascii(x) isascii((unsigned char)x)
112#define xislower(x) islower((unsigned char)x)
113#define xisalpha(x) isalpha((unsigned char)x)
ec451a0f 114#define xisprint(x) isprint((unsigned char)x)
115#define xisalnum(x) isalnum((unsigned char)x)
116#define xiscntrl(x) iscntrl((unsigned char)x)
117#define xispunct(x) ispunct((unsigned char)x)
118#define xisupper(x) isupper((unsigned char)x)
119#define xisxdigit(x) isxdigit((unsigned char)x)
ba53f4b8 120#define xisgraph(x) isgraph((unsigned char)x)
4d683a65 121
122#if HAVE_RANDOM
123#define squid_random random
124#define squid_srandom srandom
125#elif HAVE_LRAND48
126#define squid_random lrand48
127#define squid_srandom srand48
128#else
129#define squid_random rand
130#define squid_srandom srand
131#endif
132
798f959e 133/* gcc doesn't recognize the Windows native 64 bit formatting tags causing
134 * the compile fail, so we must disable the check on native Windows.
c5dd4956 135 */
798f959e 136
137#if __GNUC__ && !defined(_SQUID_MSWIN_)
68361fc4 138#define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2)))
139#define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3)))
140#define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4)))
392bbafe 141#else
68361fc4 142#define PRINTF_FORMAT_ARG1
143#define PRINTF_FORMAT_ARG2
144#define PRINTF_FORMAT_ARG3
392bbafe 145#endif
146
b4bab919 147/*
148 * Determine if this is a leak check build or standard
149 */
150#if PURIFY
151#define LEAK_CHECK_MODE 1
152#elif WITH_VALGRIND
153#define LEAK_CHECK_MODE 1
154#elif XMALLOC_TRACE
155#define LEAK_CHECK_MODE 1
156#endif
157
82b7abe3
AJ
158/* temp hack: needs to be pre-defined for now. */
159#define SQUID_MAXPATHLEN 256
cee08cbc
AJ
160
161/*
162 * strnstr() is needed. The OS may not provide a working copy.
163 */
164#include "strnstr.h"
165
b5638623 166#endif /* SQUID_CONFIG_H */