]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/types.h
Merged from trunk
[thirdparty/squid.git] / compat / types.h
1 #ifndef SQUID_CONFIG_H
2 #include "config.h"
3 #endif
4
5 /*
6 * * * * * * * * Legal stuff * * * * * * *
7 *
8 * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>
9 *
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.
14 *
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.
19 *
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 * ----------------------------------------------------------
24 *
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.
33 *
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.
38 *
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.
43 *
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.
47 *
48 * * * * * * * * Declaration of intents * * * * * * *
49 *
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
53 *
54 * This file is only intended to be included via compat/compat.h, do
55 * not include directly.
56 */
57
58 #ifndef SQUID_TYPES_H
59 #define SQUID_TYPES_H
60
61 /* This should be in synch with what we have in acinclude.m4 */
62 #if HAVE_SYS_TYPES_H
63 #include <sys/types.h>
64 #endif
65 #if HAVE_LINUX_TYPES_H
66 #include <linux/types.h>
67 #endif
68 #if HAVE_STDLIB_H
69 #include <stdlib.h>
70 #endif
71 #if HAVE_STDDEF_H
72 #include <stddef.h>
73 #endif
74 #if HAVE_INTTYPES_H
75 #include <inttypes.h>
76 #endif
77 #if HAVE_SYS_BITYPES_H
78 #include <sys/bitypes.h>
79 #endif
80 #if HAVE_SYS_SELECT_H
81 #include <sys/select.h>
82 #endif
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>
86 #endif
87
88
89 /******************************************************/
90 /* Typedefs for missing entries on a system */
91 /******************************************************/
92
93
94 /*
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"
98 */
99 #ifndef PRId64
100 #ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */
101 #define PRId64 "I64d"
102 #elif SIZEOF_INT64_T > SIZEOF_LONG
103 #define PRId64 "lld"
104 #else
105 #define PRId64 "ld"
106 #endif
107 #endif
108
109 #ifndef PRIu64
110 #ifdef _SQUID_MSWIN_ /* Windows native port using MSVCRT */
111 #define PRIu64 "I64u"
112 #elif SIZEOF_INT64_T > SIZEOF_LONG
113 #define PRIu64 "llu"
114 #else
115 #define PRIu64 "lu"
116 #endif
117 #endif
118
119 #ifndef HAVE_MODE_T
120 typedef unsigned short mode_t;
121 #endif
122
123 #ifndef HAVE_FD_MASK
124 typedef unsigned long fd_mask;
125 #endif
126
127 #ifndef HAVE_SOCKLEN_T
128 typedef int socklen_t;
129 #endif
130
131 #ifndef HAVE_MTYP_T
132 typedef long mtyp_t;
133 #endif
134
135 #endif /* SQUID_TYPES_H */