2 * Copyright 2006, Broadcom Corporation
5 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
6 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
7 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
16 /* Define 'SITE_TYPEDEFS' in the compile to include a site specific
17 * typedef file "site_typedefs.h".
19 * If 'SITE_TYPEDEFS' is not defined, then the "Inferred Typedefs"
20 * section of this file makes inferences about the compile environment
21 * based on defined symbols and possibly compiler pragmas.
23 * Following these two sections is the "Default Typedefs"
24 * section. This section is only prcessed if 'USE_TYPEDEF_DEFAULTS' is
25 * defined. This section has a default set of typedefs and a few
26 * proprocessor symbols (TRUE, FALSE, NULL, ...).
32 * Site Specific Typedefs
36 #include "site_typedefs.h"
45 /* Infer the compile environment based on preprocessor symbols and pramas.
46 * Override type definitions as needed, and include configuration dependent
47 * header files to define types.
60 #else /* ! __cplusplus */
65 typedef unsigned char bool; /* consistent w/BOOL */
69 #endif /* ! __cplusplus */
71 /* use the Windows ULONG_PTR type when compiling for 64 bit */
74 #define TYPEDEF_UINTPTR
75 typedef ULONG_PTR uintptr
;
83 #if defined(_NEED_SIZE_T_)
84 typedef long unsigned int size_t;
88 typedef long unsigned int size_t;
89 #endif /* __DJGPP__ */
91 #ifdef _MSC_VER /* Microsoft C */
93 #define TYPEDEF_UINT64
94 typedef signed __int64 int64
;
95 typedef unsigned __int64 uint64
;
102 #if defined(__NetBSD__)
103 #define TYPEDEF_ULONG
109 #define TYPEDEF_USHORT
110 #define TYPEDEF_ULONG
113 #if !defined(linux) && !defined(_WIN32) && !defined(_CFE_) && \
114 !defined(_HNDRTE_) && !defined(_MINOSL_) && !defined(__DJGPP__)
116 #define TYPEDEF_USHORT
120 /* Do not support the (u)int64 types with strict ansi for GNU C */
121 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
122 #define TYPEDEF_INT64
123 #define TYPEDEF_UINT64
126 /* ICL accepts unsigned 64 bit type only, and complains in ANSI mode
127 * for singned or unsigned
131 #define TYPEDEF_INT64
133 #if defined(__STDC__)
134 #define TYPEDEF_UINT64
139 #if !defined(_WIN32) && !defined(_CFE_) && !defined(_MINOSL_) && \
142 /* pick up ushort & uint from standard types.h */
143 #if defined(linux) && defined(__KERNEL__)
145 #include <linux/types.h> /* sys/types.h and linux/types.h are oil and water */
149 #include <sys/types.h>
157 #ifdef __BIG_ENDIAN__
161 #error "IL_BIGENDIAN was defined for a little-endian compile"
163 #endif /* __BIG_ENDIAN__ */
165 #if !defined(__cplusplus)
167 #if defined(__i386__)
168 typedef unsigned char bool;
170 typedef unsigned int bool;
179 #include <IOKit/IOTypes.h>
182 #endif /* __cplusplus */
187 /* use the default typedefs in the next section of this file */
188 #define USE_TYPEDEF_DEFAULTS
190 #endif /* SITE_TYPEDEFS */
198 #ifdef USE_TYPEDEF_DEFAULTS
199 #undef USE_TYPEDEF_DEFAULTS
202 typedef /* @abstract@ */ unsigned char bool;
205 /* define uchar, ushort, uint, ulong */
207 #ifndef TYPEDEF_UCHAR
208 typedef unsigned char uchar
;
211 #ifndef TYPEDEF_USHORT
212 typedef unsigned short ushort
;
216 typedef unsigned int uint
;
219 #ifndef TYPEDEF_ULONG
220 typedef unsigned long ulong
;
223 /* define [u]int8/16/32/64, uintptr */
225 #ifndef TYPEDEF_UINT8
226 typedef unsigned char uint8
;
229 #ifndef TYPEDEF_UINT16
230 typedef unsigned short uint16
;
233 #ifndef TYPEDEF_UINT32
234 typedef unsigned int uint32
;
237 #ifndef TYPEDEF_UINT64
238 typedef unsigned long long uint64
;
241 #ifndef TYPEDEF_UINTPTR
242 typedef unsigned int uintptr
;
246 typedef signed char int8
;
249 #ifndef TYPEDEF_INT16
250 typedef signed short int16
;
253 #ifndef TYPEDEF_INT32
254 typedef signed int int32
;
257 #ifndef TYPEDEF_INT64
258 typedef signed long long int64
;
261 /* define float32/64, float_t */
263 #ifndef TYPEDEF_FLOAT32
264 typedef float float32
;
267 #ifndef TYPEDEF_FLOAT64
268 typedef double float64
;
272 * abstracted floating point type allows for compile time selection of
273 * single or double precision arithmetic. Compiling with -DFLOAT32
274 * selects single precision; the default is double precision.
277 #ifndef TYPEDEF_FLOAT_T
280 typedef float32 float_t
;
281 #else /* default to double precision floating point */
282 typedef float64 float_t
;
285 #endif /* TYPEDEF_FLOAT_T */
287 /* define macro values */
294 #define TRUE 1 /* TRUE */
306 #define ON 1 /* ON = 1 */
309 #define AUTO (-1) /* Auto = -1 */
311 /* define PTRSZ, INLINE */
314 #define PTRSZ sizeof(char*)
321 #define INLINE __inline
323 #elif defined(__GNUC__)
325 #define INLINE __inline__
331 #endif /* _MSC_VER */
337 #undef TYPEDEF_USHORT
341 #undef TYPEDEF_UINT16
342 #undef TYPEDEF_UINT32
343 #undef TYPEDEF_UINT64
344 #undef TYPEDEF_UINTPTR
349 #undef TYPEDEF_FLOAT32
350 #undef TYPEDEF_FLOAT64
351 #undef TYPEDEF_FLOAT_T
353 #endif /* USE_TYPEDEF_DEFAULTS */
356 * Including the bcmdefs.h here, to make sure everyone including typedefs.h
357 * gets this automatically
361 #endif /* _TYPEDEFS_H_ */