1 2 /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 #ifndef COM_DTYPES_H 18 #define COM_DTYPES_H 19 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 /* For NT apps we want to use the Win32 definitions and/or those 26 supplied by the Win32 compiler for things like NULL, MAX, MIN 27 abs, labs, etc. 28 */ 29 #ifdef T_WINNT 30 #ifndef WIN32 31 #define WIN32 32 #endif 33 #include <stdlib.h> 34 #endif 35 36 /* ------------------------------------------------------------------------ 37 ** Constants 38 ** ------------------------------------------------------------------------ */ 39 40 #ifdef TRUE 41 #undef TRUE 42 #endif 43 44 #ifdef FALSE 45 #undef FALSE 46 #endif 47 48 /** @addtogroup utils_services 49 @{ */ 50 51 /** @name Macros for Common Data Types 52 @{ */ 53 #define TRUE 1 /**< Boolean TRUE value. */ 54 #define FALSE 0 /**< Boolean FALSE value. */ 55 56 #define ON 1 /**< ON value. */ 57 #define OFF 0 /**< OFF value. */ 58 59 #ifndef NULL 60 #define NULL 0 /**< NULL value. */ 61 #endif 62 /** @} */ /* end_name_group Macros for Common Data Types */ 63 64 /* ----------------------------------------------------------------------- 65 ** Standard Types 66 ** ----------------------------------------------------------------------- */ 67 68 /** @} */ /* end_addtogroup utils_services */ 69 70 /* The following definitions are the same across platforms. This first 71 group are the sanctioned types. 72 */ 73 #ifndef _ARM_ASM_ 74 #ifndef _BOOLEAN_DEFINED 75 76 /** @addtogroup utils_services 77 @{ */ 78 /** Boolean value type. 79 */ 80 typedef unsigned char boolean; 81 #define _BOOLEAN_DEFINED 82 #endif 83 84 /** @cond 85 */ 86 #if defined(DALSTDDEF_H) /* guards against a known re-definer */ 87 #define _BOOLEAN_DEFINED 88 #define _UINT32_DEFINED 89 #define _UINT16_DEFINED 90 #define _UINT8_DEFINED 91 #define _INT32_DEFINED 92 #define _INT16_DEFINED 93 #define _INT8_DEFINED 94 #define _UINT64_DEFINED 95 #define _INT64_DEFINED 96 #define _BYTE_DEFINED 97 #endif /* #if !defined(DALSTDDEF_H) */ 98 /** @endcond */ 99 100 #ifndef _UINT32_DEFINED 101 /** Unsigned 32-bit value. 102 */ 103 typedef unsigned int uint32; 104 #define _UINT32_DEFINED 105 #endif 106 107 #ifndef _UINT16_DEFINED 108 /** Unsigned 16-bit value. 109 */ 110 typedef unsigned short uint16; 111 #define _UINT16_DEFINED 112 #endif 113 114 #ifndef _UINT8_DEFINED 115 /** Unsigned 8-bit value. 116 */ 117 typedef unsigned char uint8; 118 #define _UINT8_DEFINED 119 #endif 120 121 #ifndef _INT32_DEFINED 122 /** Signed 32-bit value. 123 */ 124 typedef signed int int32; 125 #define _INT32_DEFINED 126 #endif 127 128 #ifndef _INT16_DEFINED 129 /** Signed 16-bit value. 130 */ 131 typedef signed short int16; 132 #define _INT16_DEFINED 133 #endif 134 135 #ifndef _INT8_DEFINED 136 /** Signed 8-bit value. 137 */ 138 typedef signed char int8; 139 #define _INT8_DEFINED 140 #endif 141 142 /** @cond 143 */ 144 /* This group are the deprecated types. Their use should be 145 ** discontinued and new code should use the types above 146 */ 147 #ifndef _BYTE_DEFINED 148 /** DEPRECATED: Unsigned 8 bit value type. 149 */ 150 typedef unsigned char byte; 151 #define _BYTE_DEFINED 152 #endif 153 154 /** DEPRECATED: Unsinged 16 bit value type. 155 */ 156 typedef unsigned short word; 157 /** DEPRECATED: Unsigned 32 bit value type. 158 */ 159 typedef unsigned long dword; 160 161 /** DEPRECATED: Unsigned 8 bit value type. 162 */ 163 typedef unsigned char uint1; 164 /** DEPRECATED: Unsigned 16 bit value type. 165 */ 166 typedef unsigned short uint2; 167 /** DEPRECATED: Unsigned 32 bit value type. 168 */ 169 typedef unsigned long uint4; 170 171 /** DEPRECATED: Signed 8 bit value type. 172 */ 173 typedef signed char int1; 174 /** DEPRECATED: Signed 16 bit value type. 175 */ 176 typedef signed short int2; 177 /** DEPRECATED: Signed 32 bit value type. 178 */ 179 typedef long int int4; 180 181 /** DEPRECATED: Signed 32 bit value. 182 */ 183 typedef signed long sint31; 184 /** DEPRECATED: Signed 16 bit value. 185 */ 186 typedef signed short sint15; 187 /** DEPRECATED: Signed 8 bit value. 188 */ 189 typedef signed char sint7; 190 191 typedef uint16 UWord16 ; 192 typedef uint32 UWord32 ; 193 typedef int32 Word32 ; 194 typedef int16 Word16 ; 195 typedef uint8 UWord8 ; 196 typedef int8 Word8 ; 197 typedef int32 Vect32 ; 198 /** @endcond */ 199 200 #if (! defined T_WINNT) && (! defined __GNUC__) 201 /* Non WinNT Targets */ 202 #ifndef _INT64_DEFINED 203 /** Signed 64-bit value. 204 */ 205 typedef long long int64; 206 #define _INT64_DEFINED 207 #endif 208 #ifndef _UINT64_DEFINED 209 /** Unsigned 64-bit value. 210 */ 211 typedef unsigned long long uint64; 212 #define _UINT64_DEFINED 213 #endif 214 #else /* T_WINNT || TARGET_OS_SOLARIS || __GNUC__ */ 215 /* WINNT or SOLARIS based targets */ 216 #if (defined __GNUC__) 217 #ifndef _INT64_DEFINED 218 typedef long long int64; 219 #define _INT64_DEFINED 220 #endif 221 #ifndef _UINT64_DEFINED 222 typedef unsigned long long uint64; 223 #define _UINT64_DEFINED 224 #endif 225 #else 226 typedef __int64 int64; /* Signed 64-bit value */ 227 #ifndef _UINT64_DEFINED 228 typedef unsigned __int64 uint64; /* Unsigned 64-bit value */ 229 #define _UINT64_DEFINED 230 #endif 231 #endif 232 #endif /* T_WINNT */ 233 234 #endif /* _ARM_ASM_ */ 235 236 #ifdef __cplusplus 237 } 238 #endif 239 240 /** @} */ /* end_addtogroup utils_services */ 241 #endif /* COM_DTYPES_H */ 242