1 /* 2 * Copyright (C) 1999-2009, Broadcom Corporation 3 * 4 * Unless you and Broadcom execute a separate written software license 5 * agreement governing use of this software, this software is licensed to you 6 * under the terms of the GNU General Public License version 2 (the "GPL"), 7 * available at http://www.broadcom.com/licenses/GPLv2.php, with the 8 * following added to such license: 9 * 10 * As a special exception, the copyright holders of this software give you 11 * permission to link this software with independent modules, and to copy and 12 * distribute the resulting executable under terms of your choice, provided that 13 * you also meet, for each linked independent module, the terms and conditions of 14 * the license of that module. An independent module is a module which is not 15 * derived from this software. The special exception does not apply to any 16 * modifications of the software. 17 * 18 * Notwithstanding the above, under no circumstances may you combine this 19 * software in any way with any other Broadcom software provided under a license 20 * other than the GPL, without Broadcom's express prior written consent. 21 * $Id: typedefs.h,v 1.85.34.1.2.5 2009/01/27 04:09:40 Exp $ 22 */ 23 24 25 #ifndef _TYPEDEFS_H_ 26 #define _TYPEDEFS_H_ 27 28 #ifdef SITE_TYPEDEFS 29 30 31 32 #include "site_typedefs.h" 33 34 #else 35 36 37 38 #ifdef __cplusplus 39 40 #define TYPEDEF_BOOL 41 #ifndef FALSE 42 #define FALSE false 43 #endif 44 #ifndef TRUE 45 #define TRUE true 46 #endif 47 48 #else 49 50 51 #endif 52 53 #if defined(__x86_64__) 54 #define TYPEDEF_UINTPTR 55 typedef unsigned long long int uintptr; 56 #endif 57 58 59 60 61 #if defined(TARGETOS_nucleus) 62 63 #include <stddef.h> 64 65 66 #define TYPEDEF_FLOAT_T 67 #endif 68 69 #if defined(_NEED_SIZE_T_) 70 typedef long unsigned int size_t; 71 #endif 72 73 #ifdef __DJGPP__ 74 typedef long unsigned int size_t; 75 #endif 76 77 78 79 80 81 #define TYPEDEF_UINT 82 #ifndef TARGETENV_android 83 #define TYPEDEF_USHORT 84 #define TYPEDEF_ULONG 85 #endif 86 #ifdef __KERNEL__ 87 #include <linux/version.h> 88 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)) 89 #define TYPEDEF_BOOL 90 #endif 91 #endif 92 93 94 95 96 97 #if defined(__GNUC__) && defined(__STRICT_ANSI__) 98 #define TYPEDEF_INT64 99 #define TYPEDEF_UINT64 100 #endif 101 102 103 #if defined(__ICL) 104 105 #define TYPEDEF_INT64 106 107 #if defined(__STDC__) 108 #define TYPEDEF_UINT64 109 #endif 110 111 #endif 112 113 #if !defined(__DJGPP__) && !defined(TARGETOS_nucleus) 114 115 116 #if defined(__KERNEL__) 117 118 #include <linux/types.h> 119 120 #else 121 122 123 #include <sys/types.h> 124 125 #endif 126 127 #endif 128 129 130 131 132 #define USE_TYPEDEF_DEFAULTS 133 134 #endif 135 136 137 138 139 #ifdef USE_TYPEDEF_DEFAULTS 140 #undef USE_TYPEDEF_DEFAULTS 141 142 #ifndef TYPEDEF_BOOL 143 typedef unsigned char bool; 144 #endif 145 146 147 148 #ifndef TYPEDEF_UCHAR 149 typedef unsigned char uchar; 150 #endif 151 152 #ifndef TYPEDEF_USHORT 153 typedef unsigned short ushort; 154 #endif 155 156 #ifndef TYPEDEF_UINT 157 typedef unsigned int uint; 158 #endif 159 160 #ifndef TYPEDEF_ULONG 161 typedef unsigned long ulong; 162 #endif 163 164 165 166 #ifndef TYPEDEF_UINT8 167 typedef unsigned char uint8; 168 #endif 169 170 #ifndef TYPEDEF_UINT16 171 typedef unsigned short uint16; 172 #endif 173 174 #ifndef TYPEDEF_UINT32 175 typedef unsigned int uint32; 176 #endif 177 178 #ifndef TYPEDEF_UINT64 179 typedef unsigned long long uint64; 180 #endif 181 182 #ifndef TYPEDEF_UINTPTR 183 typedef unsigned int uintptr; 184 #endif 185 186 #ifndef TYPEDEF_INT8 187 typedef signed char int8; 188 #endif 189 190 #ifndef TYPEDEF_INT16 191 typedef signed short int16; 192 #endif 193 194 #ifndef TYPEDEF_INT32 195 typedef signed int int32; 196 #endif 197 198 #ifndef TYPEDEF_INT64 199 typedef signed long long int64; 200 #endif 201 202 203 204 #ifndef TYPEDEF_FLOAT32 205 typedef float float32; 206 #endif 207 208 #ifndef TYPEDEF_FLOAT64 209 typedef double float64; 210 #endif 211 212 213 214 #ifndef TYPEDEF_FLOAT_T 215 216 #if defined(FLOAT32) 217 typedef float32 float_t; 218 #else 219 typedef float64 float_t; 220 #endif 221 222 #endif 223 224 225 226 #ifndef FALSE 227 #define FALSE 0 228 #endif 229 230 #ifndef TRUE 231 #define TRUE 1 232 #endif 233 234 #ifndef NULL 235 #define NULL 0 236 #endif 237 238 #ifndef OFF 239 #define OFF 0 240 #endif 241 242 #ifndef ON 243 #define ON 1 244 #endif 245 246 #define AUTO (-1) 247 248 249 250 #ifndef PTRSZ 251 #define PTRSZ sizeof(char*) 252 #endif 253 254 255 256 #if defined(__GNUC__) 257 #define BWL_COMPILER_GNU 258 #elif defined(__CC_ARM) 259 #define BWL_COMPILER_ARMCC 260 #else 261 #error "Unknown compiler!" 262 #endif 263 264 265 #ifndef INLINE 266 #if defined(BWL_COMPILER_MICROSOFT) 267 #define INLINE __inline 268 #elif defined(BWL_COMPILER_GNU) 269 #define INLINE __inline__ 270 #elif defined(BWL_COMPILER_ARMCC) 271 #define INLINE __inline 272 #else 273 #define INLINE 274 #endif 275 #endif 276 277 #undef TYPEDEF_BOOL 278 #undef TYPEDEF_UCHAR 279 #undef TYPEDEF_USHORT 280 #undef TYPEDEF_UINT 281 #undef TYPEDEF_ULONG 282 #undef TYPEDEF_UINT8 283 #undef TYPEDEF_UINT16 284 #undef TYPEDEF_UINT32 285 #undef TYPEDEF_UINT64 286 #undef TYPEDEF_UINTPTR 287 #undef TYPEDEF_INT8 288 #undef TYPEDEF_INT16 289 #undef TYPEDEF_INT32 290 #undef TYPEDEF_INT64 291 #undef TYPEDEF_FLOAT32 292 #undef TYPEDEF_FLOAT64 293 #undef TYPEDEF_FLOAT_T 294 295 #endif 296 297 298 #define UNUSED_PARAMETER(x) (void)(x) 299 300 301 #include <bcmdefs.h> 302 303 #endif 304