2 * Watt-32 type definitions.
6 * Copyright (c) 1982, 1986, 1991 The Regents of the University of California.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * @(#)types.h 7.17 (Berkeley) 5/6/91
38 * @(#)wtypes.h Waterloo TCP/IP
42 * the naming <sys/wtypes.h> is required for those compilers that
43 * have <sys/types.h> in the usual place but doesn't define
44 * the following types. This file is included from <sys/socket.h>,
48 #ifndef __SYS_WTYPES_H
49 #define __SYS_WTYPES_H
51 #if 0 /* No, that causes trouble */
53 #define FD_SETSIZE 512 /* use same FD_SETSIZE for all targets */
56 #if defined(__DJGPP__) || defined(__DMC__) || defined(__MINGW32__) || defined(__POCC__)
57 #include <sys/types.h>
60 #if defined(__DJGPP__)
61 #include <machine/endian.h>
64 #if defined(__MINGW32__) || (defined(__DJGPP__) && DJGPP_MINOR >= 4) || \
65 (defined(__WATCOMC__) && __WATCOMC__ >= 1230) || /* OW 1.3+ */ \
66 defined(__POCC__) /* PellesC */
69 #include <stdint.h> /* doesn't define 'u_char' etc. */
73 #if !defined(HAVE_U_INT64_T) && !defined(u_int64_t)
74 #if defined(__HIGHC__) || defined(__GNUC__)
75 typedef unsigned long long u_int64_t;
76 #define HAVE_U_INT64_T
78 #elif defined(__DMC__) && (__INTSIZE == 4)
79 typedef unsigned long long u_int64_t;
80 #define HAVE_U_INT64_T
82 #elif defined(__WATCOMC__) && defined(__WATCOM_INT64__)
83 typedef unsigned __int64 u_int64_t;
84 #define HAVE_U_INT64_T
86 #elif (defined(_MSC_VER) && (_MSC_VER >= 900)) || defined(__POCC__)
87 typedef unsigned __int64 u_int64_t;
88 #define HAVE_U_INT64_T
92 #if !defined(__GLIBC__)
93 #if !defined(HAVE_U_CHAR) && !defined(u_char)
94 typedef unsigned char u_char;
98 #if !defined(HAVE_U_SHORT) && !defined(u_short)
99 typedef unsigned short u_short;
103 #if !defined(HAVE_USHORT) && !defined(ushort)
104 typedef unsigned short ushort; /* SysV compatibility */
108 #if !defined(HAVE_U_LONG) && !defined(u_long)
109 typedef unsigned long u_long;
113 #if !defined(HAVE_U_INT) && !defined(u_int)
114 #if defined(__SMALL__) || defined(__LARGE__)
115 typedef unsigned long u_int; /* too many headers assumes u_int is >=32-bit */
117 typedef unsigned int u_int;
122 #if !defined(HAVE_CADDR_T) && !defined(caddr_t)
123 typedef unsigned long caddr_t;
128 #if !defined(HAVE_U_INT8_T) && !defined(u_int8_t)
129 typedef unsigned char u_int8_t;
132 #if !defined(HAVE_U_INT16_T) && !defined(u_int16_t)
133 typedef unsigned short u_int16_t;
136 #if !defined(HAVE_U_INT32_T) && !defined(u_int32_t)
137 typedef unsigned long u_int32_t;
140 #if !defined(HAVE_STDINT_H)
141 #if !defined(HAVE_INT16_T) && !defined(int16_t)
142 typedef short int16_t;
146 #if !defined(HAVE_INT32_T) && !defined(int32_t)
147 typedef long int32_t;
152 #if !defined(HAVE_U_QUAD_T) && !defined(u_quad_t)
153 #define HAVE_U_QUAD_T
154 #ifdef HAVE_U_INT64_T
155 #define u_quad_t u_int64_t
157 #define u_quad_t unsigned long
161 #if !defined(IOVEC_DEFINED)
162 #define IOVEC_DEFINED
170 #define __BIT_TYPES_DEFINED__
172 #if !defined(FD_SET) /* not djgpp */
175 #define FD_SETSIZE 512
176 #define FD_SET(n, p) ((p)->fd_bits[(n)/8] |= (1 << ((n) & 7)))
177 #define FD_CLR(n, p) ((p)->fd_bits[(n)/8] &= ~(1 << ((n) & 7)))
178 #define FD_ISSET(n,p) ((p)->fd_bits[(n)/8] & (1 << ((n) & 7)))
179 #define FD_ZERO(p) memset ((void*)(p), 0, sizeof(*(p)))
181 typedef struct fd_set {
182 unsigned char fd_bits [(FD_SETSIZE+7)/8];
186 #ifndef LITTLE_ENDIAN
187 #define LITTLE_ENDIAN 1234
191 #define BIG_ENDIAN 4321
194 #if defined(BIG_ENDIAN_MACHINE) || defined(USE_BIGENDIAN)
195 #define BYTE_ORDER BIG_ENDIAN
197 #define BYTE_ORDER LITTLE_ENDIAN