]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/types.h
6 * * * * * * * * Legal stuff * * * * * * *
8 * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * SQUID Web Proxy Cache http://www.squid-cache.org/
23 * ----------------------------------------------------------
25 * Squid is the result of efforts by numerous individuals from
26 * the Internet community; see the CONTRIBUTORS file for full
27 * details. Many organizations have provided support for Squid's
28 * development; see the SPONSORS file for full details. Squid is
29 * Copyrighted (C) 2001 by the Regents of the University of
30 * California; see the COPYRIGHT file for full details. Squid
31 * incorporates software developed and/or copyrighted by other
32 * sources; see the CREDITS file for full details.
34 * This program is free software; you can redistribute it and/or modify
35 * it under the terms of the GNU General Public License as published by
36 * the Free Software Foundation; either version 2 of the License, or
37 * (at your option) any later version.
39 * This program is distributed in the hope that it will be useful,
40 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 * GNU General Public License for more details.
44 * You should have received a copy of the GNU General Public License
45 * along with this program; if not, write to the Free Software
46 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
48 * * * * * * * * Declaration of intents * * * * * * *
50 * Here are defined several known-width types, obtained via autoconf
51 * from system locations or various attempts. This is just a convenience
52 * header to include which takes care of proper preprocessor stuff
54 * This file is only intended to be included via compat/compat.h, do
55 * not include directly.
61 /* This should be in synch with what we have in acinclude.m4 */
63 #include <sys/types.h>
65 #if HAVE_LINUX_TYPES_H
66 #include <linux/types.h>
77 #if HAVE_SYS_BITYPES_H
78 #include <sys/bitypes.h>
81 #include <sys/select.h>
83 #if HAVE_NETINET_IN_SYSTM_H
84 /* Several OS require types declared by in_systm.h without including it themselves. */
85 #include <netinet/in_systm.h>
89 /******************************************************/
90 /* Typedefs for missing entries on a system */
91 /******************************************************/
95 * ISO C99 Standard printf() macros for 64 bit integers
96 * On some 64 bit platform, HP Tru64 is one, for printf must be used
97 * "%lx" instead of "%llx"
100 #ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */
101 #define PRId64 "I64d"
102 #elif SIZEOF_INT64_T > SIZEOF_LONG
110 #ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */
111 #define PRIu64 "I64u"
112 #elif SIZEOF_INT64_T > SIZEOF_LONG
122 typedef __int64
int64_t;
123 #elif HAVE_LONG && SIZEOF_LONG == 8
124 typedef long int64_t;
125 #elif HAVE_LONG_LONG && SIZEOF_LONG_LONG == 8
126 typedef long long int64_t;
128 #error NO 64 bit signed type available
135 typedef u_int64_t
uint64_t;
136 #define HAVE_UINT64_T 1
138 typedef unsigned int64_t uint64_t;
139 #define HAVE_UINT64_T 1
140 #endif /* HAVE_U_INT64_T */
141 #endif /* HAVE_UINT64_T */
145 #if HAVE_INT && SIZEOF_INT == 4
147 #elif HAVE_LONG && SIZEOF_LONG == 4
148 typedef long int32_t;
150 #error NO 32 bit signed type available
157 typedef u_int32_t
uint32_t;
158 #define HAVE_UINT32_T 1
160 typedef unsigned int32_t uint32_t;
161 #define HAVE_UINT32_T 1
162 #endif /* HAVE_U_INT32_T */
163 #endif /* HAVE_UINT32_T */
167 #if HAVE_SHORT && SIZEOF_SHORT == 2
168 typedef short int16_t;
169 #elif HAVE_INT && SIZEOF_INT == 2
172 #error NO 16 bit signed type available
179 typedef u_int16_t
uint16_t;
180 #define HAVE_UINT16_T 1
182 typedef unsigned int16_t uint16_t;
183 #define HAVE_UINT16_T 1
184 #endif /* HAVE_U_INT16_T */
185 #endif /* HAVE_UINT16_T */
189 #if HAVE_CHAR && SIZEOF_CHAR == 1
192 #error NO 8 bit signed type available
199 typedef u_int8_t
uint8_t;
200 #define HAVE_UINT8_T 1
202 typedef unsigned int8_t uint8_t;
203 #define HAVE_UINT8_T 1
204 #endif /* HAVE_U_INT8_T */
205 #endif /* HAVE_UINT8_T */
208 #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */
216 typedef unsigned int size_t;
224 #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */
225 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
226 typedef int64_t off_t
;
236 typedef unsigned short mode_t
;
240 typedef unsigned long fd_mask
;
243 #ifndef HAVE_SOCKLEN_T
244 typedef int socklen_t
;
251 #endif /* SQUID_TYPES_H */