]>
git.ipfire.org Git - thirdparty/squid.git/blob - include/config.h
2 * $Id: config.h,v 1.15 2004/12/21 17:28:27 robertc Exp $
4 * AUTHOR: Duane Wessels
6 * SQUID Web Proxy Cache http://www.squid-cache.org/
7 * ----------------------------------------------------------
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.
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.
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.
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.
34 #ifndef SQUID_CONFIG_H
35 #define SQUID_CONFIG_H
37 #include "autoconf.h" /* For GNU autoconf variables */
40 /* To keep API definitions clear */
42 #define SQUIDCEXTERN extern "C"
44 #define SQUIDCEXTERN extern
47 /****************************************************************************
48 *--------------------------------------------------------------------------*
49 * DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
50 *--------------------------------------------------------------------------*
51 ****************************************************************************/
53 #ifdef USE_POSIX_REGEX
55 #define USE_RE_SYNTAX REG_EXTENDED /* default Syntax */
59 /* define the _SQUID_TYPE_ based on a guess of the OS */
60 #if defined(__sun__) || defined(__sun) /* SUN */
62 #if defined(__SVR4) /* SOLARIS */
63 #define _SQUID_SOLARIS_
68 #elif defined(__hpux) /* HP-UX - SysV-like? */
72 #elif defined(__osf__) /* OSF/1 */
75 #elif defined(__ultrix) /* Ultrix */
76 #define _SQUID_ULTRIX_
78 #elif defined(_AIX) /* AIX */
81 #elif defined(__linux__) /* Linux */
84 #define _SQUID_LINUX_THREADS_
87 #elif defined(__FreeBSD__) /* FreeBSD */
88 #define _SQUID_FREEBSD_
89 #if USE_ASYNC_IO && defined(LINUXTHREADS)
90 #define _SQUID_LINUX_THREADS_
93 #elif defined(__sgi__) || defined(sgi) || defined(__sgi) /* SGI */
95 #if !defined(_SVR4_SOURCE)
96 #define _SVR4_SOURCE /* for tempnam(3) */
100 #endif /* USE_ASYNC_IO */
102 #elif defined(__NeXT__)
105 #elif defined(__bsdi__)
106 #define _SQUID_BSDI_ /* BSD/OS */
108 #elif defined(__NetBSD__)
109 #define _SQUID_NETBSD_
111 #elif defined(__OpenBSD__)
112 #define _SQUID_OPENBSD_
114 #elif defined(__CYGWIN32__) || defined(__CYGWIN__)
115 #define _SQUID_CYGWIN_
116 #define _SQUID_WIN32_
118 #elif defined(WIN32) || defined(WINNT) || defined(__WIN32__) || defined(__WIN32)
119 #define _SQUID_MSWIN_
120 #define _SQUID_WIN32_
122 #elif defined(__APPLE__)
123 #define _SQUID_APPLE_
125 #elif defined(sony_news) && defined(__svr4)
126 #define _SQUID_NEWSOS6_
128 #elif defined(__EMX__) || defined(OS2) || defined(__OS2__)
131 * FIXME: the os2 port of bash seems to have problems checking
132 * the return codes of programs in if statements. These options
133 * need to be overridden.
137 /* FD_SETSIZE must be redefined before including sys/types.h */
140 * On some systems, FD_SETSIZE is set to something lower than the
141 * actual number of files which can be opened. IRIX is one case,
142 * NetBSD is another. So here we increase FD_SETSIZE to our
143 * configure-discovered maximum *before* any system includes.
145 #define CHANGE_FD_SETSIZE 1
148 * Cannot increase FD_SETSIZE on Linux, but we can increase __FD_SETSIZE
149 * with glibc 2.2 (or later? remains to be seen). We do this by including
150 * bits/types.h which defines __FD_SETSIZE first, then we redefine
151 * __FD_SETSIZE. Ofcourse a user program may NEVER include bits/whatever.h
152 * directly, so this is a dirty hack!
154 #if defined(_SQUID_LINUX_)
155 #undef CHANGE_FD_SETSIZE
156 #define CHANGE_FD_SETSIZE 0
157 #include <features.h>
158 #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
159 #if SQUID_MAXFD > DEFAULT_FD_SETSIZE
160 #include <bits/types.h>
162 #define __FD_SETSIZE SQUID_MAXFD
168 * Cannot increase FD_SETSIZE on FreeBSD before 2.2.0, causes select(2)
170 * --Marian Durkovic <marian@svf.stuba.sk>
171 * --Peter Wemm <peter@spinner.DIALix.COM>
173 #if defined(_SQUID_FREEBSD_)
174 #include <osreldate.h>
175 #if __FreeBSD_version < 220000
176 #undef CHANGE_FD_SETSIZE
177 #define CHANGE_FD_SETSIZE 0
182 * Trying to redefine CHANGE_FD_SETSIZE causes a slew of warnings
183 * on Mac OS X Server.
185 #if defined(_SQUID_APPLE_)
186 #undef CHANGE_FD_SETSIZE
187 #define CHANGE_FD_SETSIZE 0
190 /* Increase FD_SETSIZE if SQUID_MAXFD is bigger */
191 #if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE
192 #define FD_SETSIZE SQUID_MAXFD
197 /* Typedefs for missing entries on a system */
199 #include "squid_types.h"
203 #if HAVE_SHORT && SIZEOF_SHORT == 2
204 typedef short int16_t;
205 #elif HAVE_INT && SIZEOF_INT == 2
208 #error NO 16 bit signed type available
213 #ifndef HAVE_U_INT16_T
215 typedef uint16_t u_int16_t
;
217 typedef unsigned int16_t u_int16_t
;
223 #if HAVE_INT && SIZEOF_INT == 4
225 #elif HAVE_LONG && SIZEOF_LONG == 4
226 typedef long int32_t;
228 #error NO 32 bit signed type available
233 #ifndef HAVE_U_INT32_T
235 typedef uint32_t u_int32_t
;
237 typedef unsigned int32_t u_int32_t
;
244 typedef __int64
int64_t;
245 #elif HAVE_LONG && SIZEOF_LONG == 8
246 typedef long int64_t;
247 #elif HAVE_LONG_LONG && SIZEOF_LONG_LONG == 8
248 typedef long long int64_t;
250 #error NO 64 bit signed type available
255 #ifndef HAVE_U_INT64_T
257 typedef uint64_t u_int64_t
;
259 typedef unsigned int64_t u_int64_t
;
269 typedef unsigned int size_t;
281 typedef unsigned short mode_t
;
285 typedef unsigned long fd_mask
;
288 #ifndef HAVE_SOCKLEN_T
289 typedef int socklen_t
;
297 * On Solaris 9 x86, gcc may includes a "fixed" set of old system include files
298 * that is incompatible with the updated Solaris header files.
300 #if defined(_SQUID_SOLARIS_) && (defined(i386) || defined(__i386))
316 * Don't allow inclusion of malloc.h on FreeBSD, Next and OpenBSD
318 #if defined(HAVE_MALLOC_H) && (defined(_SQUID_FREEBSD_) || defined(_SQUID_NEXT_) || defined(_SQUID_OPENBSD_))
322 #if !defined(CACHEMGR_HOSTNAME)
323 #define CACHEMGR_HOSTNAME ""
326 #if SQUID_DETECT_UDP_SO_SNDBUF > 16384
327 #define SQUID_UDP_SO_SNDBUF 16384
329 #define SQUID_UDP_SO_SNDBUF SQUID_DETECT_UDP_SO_SNDBUF
332 #if SQUID_DETECT_UDP_SO_RCVBUF > 16384
333 #define SQUID_UDP_SO_RCVBUF 16384
335 #define SQUID_UDP_SO_RCVBUF SQUID_DETECT_UDP_SO_RCVBUF
339 #define xmemcpy(d,s,n) memcpy((d),(s),(n))
341 #define xmemcpy(d,s,n) bcopy((s),(d),(n))
343 #define xmemcpy(d,s,n) memmove((d),(s),(n))
347 #define xmemmove(d,s,n) memmove((d),(s),(n))
349 #define xmemmove(d,s,n) bcopy((s),(d),(n))
352 #define xisspace(x) isspace((unsigned char)x)
353 #define xtoupper(x) toupper((unsigned char)x)
354 #define xtolower(x) tolower((unsigned char)x)
355 #define xisdigit(x) isdigit((unsigned char)x)
356 #define xisascii(x) isascii((unsigned char)x)
357 #define xislower(x) islower((unsigned char)x)
358 #define xisalpha(x) isalpha((unsigned char)x)
359 #define xisprint(x) isprint((unsigned char)x)
360 #define xisalnum(x) isalnum((unsigned char)x)
361 #define xiscntrl(x) iscntrl((unsigned char)x)
362 #define xispunct(x) ispunct((unsigned char)x)
363 #define xisupper(x) isupper((unsigned char)x)
364 #define xisxdigit(x) isxdigit((unsigned char)x)
367 #define squid_random random
368 #define squid_srandom srandom
370 #define squid_random lrand48
371 #define squid_srandom srand48
373 #define squid_random rand
374 #define squid_srandom srand
378 #define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2)))
379 #define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3)))
380 #define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4)))
382 #define PRINTF_FORMAT_ARG1
383 #define PRINTF_FORMAT_ARG2
384 #define PRINTF_FORMAT_ARG3
387 #endif /* SQUID_CONFIG_H */