2 * Copyright 2004, 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.
15 /* Define 'SITE_TYPEDEFS' in the compile to include a site specific
16 * typedef file "site_typedefs.h".
18 * If 'SITE_TYPEDEFS' is not defined, then the "Inferred Typedefs"
19 * section of this file makes inferences about the compile environment
20 * based on defined symbols and possibly compiler pragmas.
22 * Following these two sections is the "Default Typedefs"
23 * section. This section is only prcessed if 'USE_TYPEDEF_DEFAULTS' is
24 * defined. This section has a default set of typedefs and a few
25 * proprocessor symbols (TRUE, FALSE, NULL, ...).
30 /*******************************************************************************
31 * Site Specific Typedefs
32 *******************************************************************************/
34 #include "site_typedefs.h"
38 /*******************************************************************************
40 *******************************************************************************/
42 /* Infer the compile environment based on preprocessor symbols and pramas.
43 * Override type definitions as needed, and include configuration dependent
44 * header files to define types.
57 #else /* ! __cplusplus */
59 /* for Windows build, define bool as a uchar instead of the default int */
63 typedef unsigned char bool;
67 #endif /* ! __cplusplus */
69 #ifdef _MSC_VER /* Microsoft C */
71 #define TYPEDEF_UINT64
72 typedef signed __int64 int64
;
73 typedef unsigned __int64 uint64
;
76 #if defined(MACOSX) && defined(KERNEL)
83 #define TYPEDEF_USHORT
87 #if !defined(linux) && !defined(_WIN32) && !defined(PMON) && !defined(_CFE_)
89 #define TYPEDEF_USHORT
93 /* Do not support the (u)int64 types with strict ansi for GNU C */
94 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
96 #define TYPEDEF_UINT64
99 /* ICL accepts unsigned 64 bit type only, and complains in ANSI mode
100 * for singned or unsigned */
103 #define TYPEDEF_INT64
105 #if defined(__STDC__)
106 #define TYPEDEF_UINT64
112 #if !defined(_WIN32) && !defined(PMON) && !defined(_CFE_)
114 /* pick up ushort & uint from standard types.h */
115 #if defined(linux) && defined(__KERNEL__)
117 #include <linux/types.h> /* sys/types.h and linux/types.h are oil and water */
121 #include <sys/types.h>
125 #endif /* !_WIN32 && !PMON && !_CFE_ */
127 #if defined(MACOSX) && defined(KERNEL)
128 #include <IOKit/IOTypes.h>
132 /* use the default typedefs in the next section of this file */
133 #define USE_TYPEDEF_DEFAULTS
135 #endif /* SITE_TYPEDEFS */
138 /*******************************************************************************
140 *******************************************************************************/
142 #ifdef USE_TYPEDEF_DEFAULTS
143 #undef USE_TYPEDEF_DEFAULTS
149 /*----------------------- define uchar, ushort, uint, ulong ----------------*/
151 #ifndef TYPEDEF_UCHAR
152 typedef unsigned char uchar
;
155 #ifndef TYPEDEF_USHORT
156 typedef unsigned short ushort
;
160 typedef unsigned int uint
;
163 #ifndef TYPEDEF_ULONG
164 typedef unsigned long ulong
;
167 /*----------------------- define [u]int8/16/32/64 --------------------------*/
169 #ifndef TYPEDEF_UINT8
170 typedef unsigned char uint8
;
173 #ifndef TYPEDEF_UINT16
174 typedef unsigned short uint16
;
177 #ifndef TYPEDEF_UINT32
178 typedef unsigned int uint32
;
181 #ifndef TYPEDEF_UINT64
182 typedef unsigned long long uint64
;
186 typedef signed char int8
;
189 #ifndef TYPEDEF_INT16
190 typedef signed short int16
;
193 #ifndef TYPEDEF_INT32
194 typedef signed int int32
;
197 #ifndef TYPEDEF_INT64
198 typedef signed long long int64
;
201 /*----------------------- define float32/64, float_t -----------------------*/
203 #ifndef TYPEDEF_FLOAT32
204 typedef float float32
;
207 #ifndef TYPEDEF_FLOAT64
208 typedef double float64
;
212 * abstracted floating point type allows for compile time selection of
213 * single or double precision arithmetic. Compiling with -DFLOAT32
214 * selects single precision; the default is double precision.
217 #ifndef TYPEDEF_FLOAT_T
220 typedef float32 float_t
;
221 #else /* default to double precision floating point */
222 typedef float64 float_t
;
225 #endif /* TYPEDEF_FLOAT_T */
227 /*----------------------- define macro values -----------------------------*/
249 /*----------------------- define PTRSZ, INLINE ----------------------------*/
252 #define PTRSZ sizeof (char*)
259 #define INLINE __inline
263 #define INLINE __inline__
269 #endif /* _MSC_VER */
275 #undef TYPEDEF_USHORT
279 #undef TYPEDEF_UINT16
280 #undef TYPEDEF_UINT32
281 #undef TYPEDEF_UINT64
286 #undef TYPEDEF_FLOAT32
287 #undef TYPEDEF_FLOAT64
288 #undef TYPEDEF_FLOAT_T
290 #define ETHER_ADDR_LEN 6
292 #endif /* USE_TYPEDEF_DEFAULTS */
294 #endif /* _TYPEDEFS_H_ */
This page took 0.050577 seconds and 5 git commands to generate.