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.
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, ...).
31 /*******************************************************************************
32 * Site Specific Typedefs
33 *******************************************************************************/
35 #include "site_typedefs.h"
39 /*******************************************************************************
41 *******************************************************************************/
43 /* Infer the compile environment based on preprocessor symbols and pramas.
44 * Override type definitions as needed, and include configuration dependent
45 * header files to define types.
58 #else /* ! __cplusplus */
60 /* for Windows build, define bool as a uchar instead of the default int */
64 typedef unsigned char bool;
68 #endif /* ! __cplusplus */
70 #ifdef _MSC_VER /* Microsoft C */
72 #define TYPEDEF_UINT64
73 typedef signed __int64 int64
;
74 typedef unsigned __int64 uint64
;
77 #if defined(MACOSX) && defined(KERNEL)
84 #define TYPEDEF_USHORT
88 #if !defined(linux) && !defined(_WIN32) && !defined(PMON) && !defined(_CFE_)
90 #define TYPEDEF_USHORT
94 /* Do not support the (u)int64 types with strict ansi for GNU C */
95 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
97 #define TYPEDEF_UINT64
100 /* ICL accepts unsigned 64 bit type only, and complains in ANSI mode
101 * for singned or unsigned */
104 #define TYPEDEF_INT64
106 #if defined(__STDC__)
107 #define TYPEDEF_UINT64
113 #if !defined(_WIN32) && !defined(PMON) && !defined(_CFE_)
115 /* pick up ushort & uint from standard types.h */
116 #if defined(linux) && defined(__KERNEL__)
118 #include <linux/types.h> /* sys/types.h and linux/types.h are oil and water */
122 #include <sys/types.h>
126 #endif /* !_WIN32 && !PMON && !_CFE_ */
128 #if defined(MACOSX) && defined(KERNEL)
129 #include <IOKit/IOTypes.h>
133 /* use the default typedefs in the next section of this file */
134 #define USE_TYPEDEF_DEFAULTS
136 #endif /* SITE_TYPEDEFS */
139 /*******************************************************************************
141 *******************************************************************************/
143 #ifdef USE_TYPEDEF_DEFAULTS
144 #undef USE_TYPEDEF_DEFAULTS
150 /*----------------------- define uchar, ushort, uint, ulong ----------------*/
152 #ifndef TYPEDEF_UCHAR
153 typedef unsigned char uchar
;
156 #ifndef TYPEDEF_USHORT
157 typedef unsigned short ushort
;
161 typedef unsigned int uint
;
164 #ifndef TYPEDEF_ULONG
165 typedef unsigned long ulong
;
168 /*----------------------- define [u]int8/16/32/64 --------------------------*/
170 #ifndef TYPEDEF_UINT8
171 typedef unsigned char uint8
;
174 #ifndef TYPEDEF_UINT16
175 typedef unsigned short uint16
;
178 #ifndef TYPEDEF_UINT32
179 typedef unsigned int uint32
;
182 #ifndef TYPEDEF_UINT64
183 typedef unsigned long long uint64
;
187 typedef signed char int8
;
190 #ifndef TYPEDEF_INT16
191 typedef signed short int16
;
194 #ifndef TYPEDEF_INT32
195 typedef signed int int32
;
198 #ifndef TYPEDEF_INT64
199 typedef signed long long int64
;
202 /*----------------------- define float32/64, float_t -----------------------*/
204 #ifndef TYPEDEF_FLOAT32
205 typedef float float32
;
208 #ifndef TYPEDEF_FLOAT64
209 typedef double float64
;
213 * abstracted floating point type allows for compile time selection of
214 * single or double precision arithmetic. Compiling with -DFLOAT32
215 * selects single precision; the default is double precision.
218 #ifndef TYPEDEF_FLOAT_T
221 typedef float32 float_t
;
222 #else /* default to double precision floating point */
223 typedef float64 float_t
;
226 #endif /* TYPEDEF_FLOAT_T */
228 /*----------------------- define macro values -----------------------------*/
250 /*----------------------- define PTRSZ, INLINE ----------------------------*/
253 #define PTRSZ sizeof (char*)
260 #define INLINE __inline
264 #define INLINE __inline__
270 #endif /* _MSC_VER */
276 #undef TYPEDEF_USHORT
280 #undef TYPEDEF_UINT16
281 #undef TYPEDEF_UINT32
282 #undef TYPEDEF_UINT64
287 #undef TYPEDEF_FLOAT32
288 #undef TYPEDEF_FLOAT64
289 #undef TYPEDEF_FLOAT_T
291 #endif /* USE_TYPEDEF_DEFAULTS */
293 #endif /* _TYPEDEFS_H_ */
This page took 0.086757 seconds and 5 git commands to generate.