1 /*****************************************************************************/ 2 /* STDINT.H */ 3 /* */ 4 /* Copyright (c) 2002 Texas Instruments Incorporated */ 5 /* http://www.ti.com/ */ 6 /* */ 7 /* Redistribution and use in source and binary forms, with or without */ 8 /* modification, are permitted provided that the following conditions */ 9 /* are met: */ 10 /* */ 11 /* Redistributions of source code must retain the above copyright */ 12 /* notice, this list of conditions and the following disclaimer. */ 13 /* */ 14 /* Redistributions in binary form must reproduce the above copyright */ 15 /* notice, this list of conditions and the following disclaimer in */ 16 /* the documentation and/or other materials provided with the */ 17 /* distribution. */ 18 /* */ 19 /* Neither the name of Texas Instruments Incorporated nor the names */ 20 /* of its contributors may be used to endorse or promote products */ 21 /* derived from this software without specific prior written */ 22 /* permission. */ 23 /* */ 24 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ 25 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ 26 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ 27 /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ 28 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ 29 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ 30 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ 31 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ 32 /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ 33 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ 34 /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 35 /* */ 36 /*****************************************************************************/ 37 #ifndef _STDINT_H_ 38 #define _STDINT_H_ 39 40 #if __has_include(<sys/stdint.h>) 41 #include <sys/stdint.h> 42 #else 43 /* 7.18.1.1 Exact-width integer types */ 44 45 #if defined(__MSP430__) || defined(__TMS320C55X_PLUS_BYTE__) 46 typedef signed char int8_t; 47 typedef unsigned char uint8_t; 48 typedef int int16_t; 49 typedef unsigned int uint16_t; 50 typedef long int32_t; 51 typedef unsigned long uint32_t; 52 #elif defined(_TMS320C5XX) || defined(__TMS320C55X__) 53 typedef int int16_t; 54 typedef unsigned int uint16_t; 55 typedef long int32_t; 56 typedef unsigned long uint32_t; 57 #elif defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__ARP32__) || \ 58 defined(__PRU__) || defined(__FROZEN__) 59 typedef signed char int8_t; 60 typedef unsigned char uint8_t; 61 typedef short int16_t; 62 typedef unsigned short uint16_t; 63 typedef int int32_t; 64 typedef unsigned int uint32_t; 65 #elif defined (__TMS320C2000__) 66 #if defined(__TMS320C28XX_CLA__) 67 typedef short int16_t; 68 typedef unsigned short uint16_t; 69 typedef int int32_t; 70 typedef unsigned int uint32_t; 71 #else 72 typedef char int8_t; 73 typedef unsigned char uint8_t; 74 typedef int int16_t; 75 typedef unsigned int uint16_t; 76 typedef long int32_t; 77 typedef unsigned long uint32_t; 78 #endif 79 #endif 80 81 #if defined(__TMS320C55X__) 82 typedef long long int40_t; 83 typedef unsigned long long uint40_t; 84 #elif defined(_TMS320C6X) && !defined(__C6X_MIGRATION__) 85 typedef __int40_t int40_t; 86 typedef unsigned __int40_t uint40_t; 87 #endif 88 89 #if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__ARP32__) || \ 90 defined(__MSP430__) || defined(__PRU__) || defined(__FROZEN__) 91 typedef long long int64_t; 92 typedef unsigned long long uint64_t; 93 #elif defined(__TMS320C2000__) 94 #if defined(__TMS320C28X__) || \ 95 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 96 typedef long long int64_t; 97 typedef unsigned long long uint64_t; 98 #endif 99 #endif 100 101 /* 7.18.1.2 Minimum-width integer types */ 102 103 #if defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \ 104 defined(__TMS320C55X_PLUS_BYTE__) || defined(__ARP32__) || \ 105 defined(__PRU__) || defined(__FROZEN__) 106 typedef int8_t int_least8_t; 107 typedef uint8_t uint_least8_t; 108 #elif defined(__TMS320C2000__) || defined(_TMS320C5XX) || defined(__TMS320C55X__) 109 typedef int16_t int_least8_t; 110 typedef uint16_t uint_least8_t; 111 #endif 112 113 typedef int16_t int_least16_t; 114 typedef uint16_t uint_least16_t; 115 typedef int32_t int_least32_t; 116 typedef uint32_t uint_least32_t; 117 118 #if defined(__TMS320C55X__) || \ 119 (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) 120 typedef int40_t int_least40_t; 121 typedef uint40_t uint_least40_t; 122 #endif 123 124 #if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 125 defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) 126 typedef int64_t int_least64_t; 127 typedef uint64_t uint_least64_t; 128 #elif defined(__TMS320C2000__) 129 #if defined(__TMS320C28X__) || \ 130 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 131 typedef int64_t int_least64_t; 132 typedef uint64_t uint_least64_t; 133 #else 134 /* sorry, [u]int_least64_t not implemented for C27X, CLA */ 135 #endif 136 #elif defined(_TMS320C5XX) || defined(__TMS320C55X__) 137 /* sorry, [u]int_least64_t not implemented for C54x, C55x */ 138 #endif 139 140 /* 7.18.1.3 Fastest minimum-width integer types */ 141 142 #if defined(_TMS320C5XX) || defined(__TMS320C55X__) || defined(__MSP430__) 143 typedef int16_t int_fast8_t; 144 typedef uint16_t uint_fast8_t; 145 typedef int16_t int_fast16_t; 146 typedef uint16_t uint_fast16_t; 147 #elif defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__ARP32__) || \ 148 defined(__PRU__) || defined(__FROZEN__) 149 typedef int32_t int_fast8_t; 150 typedef uint32_t uint_fast8_t; 151 typedef int32_t int_fast16_t; 152 typedef uint32_t uint_fast16_t; 153 #elif defined (__TMS320C2000__) 154 #if defined(__TMS320C28XX_CLA__) 155 typedef int32_t int_fast8_t; 156 typedef uint32_t uint_fast8_t; 157 typedef int32_t int_fast16_t; 158 typedef uint32_t uint_fast16_t; 159 #else 160 typedef int16_t int_fast8_t; 161 typedef uint16_t uint_fast8_t; 162 typedef int16_t int_fast16_t; 163 typedef uint16_t uint_fast16_t; 164 #endif 165 #endif 166 167 typedef int32_t int_fast32_t; 168 typedef uint32_t uint_fast32_t; 169 170 #if defined(__TMS320C55X__) || \ 171 (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) 172 typedef int40_t int_fast40_t; 173 typedef uint40_t uint_fast40_t; 174 #endif 175 176 #if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 177 defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) 178 typedef int64_t int_fast64_t; 179 typedef uint64_t uint_fast64_t; 180 #elif defined(__TMS320C2000__) 181 #if defined(__TMS320C28X__) || \ 182 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 183 typedef int64_t int_fast64_t; 184 typedef uint64_t uint_fast64_t; 185 #else 186 /* sorry, [u]int_fast64_t not implemented for C27X, CLA */ 187 #endif 188 #elif defined(_TMS320C5XX) || defined(__TMS320C55X__) 189 /* sorry, [u]int_fast64_t not implemented for C54x, C55x */ 190 #endif 191 192 /* 7.18.1.4 Integer types capable of holding object pointers */ 193 #if defined(_TMS320C5XX) || defined(__TMS320C55X__) || \ 194 (defined(__MSP430__) && defined(__LARGE_CODE_MODEL__)) || \ 195 defined(__FROZEN__) 196 typedef long intptr_t; 197 typedef unsigned long uintptr_t; 198 #elif defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \ 199 defined(__ARP32__) || defined(__PRU__) 200 typedef int intptr_t; 201 typedef unsigned int uintptr_t; 202 #elif defined(__TMS320C2000__) 203 #if defined(__TMS320C28XX_CLA__) 204 typedef short intptr_t; 205 typedef unsigned short uintptr_t; 206 #else 207 typedef long intptr_t; 208 typedef unsigned long uintptr_t; 209 #endif 210 #endif 211 212 /* 7.18.1.5 Greatest-width integer types */ 213 #if defined(__TMS320C55X__) || defined(__ARM_ARCH) || defined(_TMS320C6X) || \ 214 defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) || \ 215 defined(__FROZEN__) 216 typedef long long intmax_t; 217 typedef unsigned long long uintmax_t; 218 #elif defined(_TMS320C5XX) 219 typedef long intmax_t; 220 typedef unsigned long uintmax_t; 221 #elif defined(__TMS320C2000__) 222 #if defined(__TMS320C28X__) || \ 223 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 224 typedef long long intmax_t; 225 typedef unsigned long long uintmax_t; 226 #else /* C27X or CLA */ 227 typedef long intmax_t; 228 typedef unsigned long uintmax_t; 229 #endif 230 #endif 231 232 /* 233 According to footnotes in the 1999 C standard, "C++ implementations 234 should define these macros only when __STDC_LIMIT_MACROS is defined 235 before <stdint.h> is included." 236 */ 237 #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) 238 239 /* 7.18.2 Limits of specified width integer types */ 240 241 #if defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \ 242 defined(__TMS320C55X_PLUS_BYTE__) || defined(__ARP32__) || \ 243 defined(__PRU__) || defined(__FROZEN__) 244 #define INT8_MAX 0x7f 245 #define INT8_MIN (-INT8_MAX-1) 246 #define UINT8_MAX 0xff 247 #endif 248 249 #define INT16_MAX 0x7fff 250 #define INT16_MIN (-INT16_MAX-1) 251 #define UINT16_MAX 0xffff 252 253 #define INT32_MAX 0x7fffffff 254 #define INT32_MIN (-INT32_MAX-1) 255 #define UINT32_MAX 0xffffffff 256 257 #if defined(__TMS320C55X__) || \ 258 (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) 259 #define INT40_MAX 0x7fffffffff 260 #define INT40_MIN (-INT40_MAX-1) 261 #define UINT40_MAX 0xffffffffff 262 #endif 263 264 #if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 265 defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) 266 #define INT64_MAX 0x7fffffffffffffff 267 #define INT64_MIN (-INT64_MAX-1) 268 #define UINT64_MAX 0xffffffffffffffff 269 #elif defined(__TMS320C2000__) 270 #if defined(__TMS320C28X__) || \ 271 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 272 #define INT64_MAX 0x7fffffffffffffff 273 #define INT64_MIN (-INT64_MAX-1) 274 #define UINT64_MAX 0xffffffffffffffff 275 #endif 276 #endif 277 278 #if defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__MSP430__) || \ 279 defined(__TMS320C55X_PLUS_BYTE__) || defined(__ARP32__) || \ 280 defined(__PRU__) || defined(__FROZEN__) 281 #define INT_LEAST8_MAX (INT8_MAX) 282 #define INT_LEAST8_MIN (INT8_MIN) 283 #define UINT_LEAST8_MAX (UINT8_MAX) 284 #elif defined(__TMS320C2000__) || defined(_TMS320C5XX) || defined(__TMS320C55X__) 285 #define INT_LEAST8_MAX (INT16_MAX) 286 #define INT_LEAST8_MIN (INT16_MIN) 287 #define UINT_LEAST8_MAX (UINT16_MAX) 288 #endif 289 290 #define INT_LEAST16_MAX (INT16_MAX) 291 #define INT_LEAST16_MIN (INT16_MIN) 292 #define UINT_LEAST16_MAX (UINT16_MAX) 293 #define INT_LEAST32_MAX (INT32_MAX) 294 #define INT_LEAST32_MIN (INT32_MIN) 295 #define UINT_LEAST32_MAX (UINT32_MAX) 296 297 #if defined(__TMS320C55X__) || \ 298 (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) 299 #define INT_LEAST40_MAX (INT40_MAX) 300 #define INT_LEAST40_MIN (INT40_MIN) 301 #define UINT_LEAST40_MAX (UINT40_MAX) 302 #endif 303 304 #if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 305 defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) 306 #define INT_LEAST64_MAX (INT64_MAX) 307 #define INT_LEAST64_MIN (INT64_MIN) 308 #define UINT_LEAST64_MAX (UINT64_MAX) 309 #elif defined(__TMS320C2000__) 310 #if defined(__TMS320C28X__) || \ 311 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 312 #define INT_LEAST64_MAX (INT64_MAX) 313 #define INT_LEAST64_MIN (INT64_MIN) 314 #define UINT_LEAST64_MAX (UINT64_MAX) 315 #endif 316 #endif 317 318 #if defined(_TMS320C5XX) || defined(__TMS320C55X__) 319 #define INT_FAST8_MAX (INT16_MAX) 320 #define INT_FAST8_MIN (INT16_MIN) 321 #define UINT_FAST8_MAX (UINT16_MAX) 322 #define INT_FAST16_MAX (INT16_MAX) 323 #define INT_FAST16_MIN (INT16_MIN) 324 #define UINT_FAST16_MAX (UINT16_MAX) 325 #elif defined(_TMS320C6X) || defined(__ARM_ARCH) || defined(__ARP32__) || \ 326 defined(__PRU__) || defined(__FROZEN__) 327 #define INT_FAST8_MAX (INT32_MAX) 328 #define INT_FAST8_MIN (INT32_MIN) 329 #define UINT_FAST8_MAX (UINT32_MAX) 330 #define INT_FAST16_MAX (INT32_MAX) 331 #define INT_FAST16_MIN (INT32_MIN) 332 #define UINT_FAST16_MAX (UINT32_MAX) 333 #elif defined(__MSP430__) 334 #define INT_FAST8_MAX (INT16_MAX) 335 #define INT_FAST8_MIN (INT16_MIN) 336 #define UINT_FAST8_MAX (UINT16_MAX) 337 #define INT_FAST16_MAX (INT16_MAX) 338 #define INT_FAST16_MIN (INT16_MIN) 339 #define UINT_FAST16_MAX (UINT16_MAX) 340 #elif defined (__TMS320C2000__) 341 #if defined(__TMS320C28XX_CLA__) 342 #define INT_FAST8_MAX (INT32_MAX) 343 #define INT_FAST8_MIN (INT32_MIN) 344 #define UINT_FAST8_MAX (UINT32_MAX) 345 #define INT_FAST16_MAX (INT32_MAX) 346 #define INT_FAST16_MIN (INT32_MIN) 347 #define UINT_FAST16_MAX (UINT32_MAX) 348 #else 349 #define INT_FAST8_MAX (INT16_MAX) 350 #define INT_FAST8_MIN (INT16_MIN) 351 #define UINT_FAST8_MAX (UINT16_MAX) 352 #define INT_FAST16_MAX (INT16_MAX) 353 #define INT_FAST16_MIN (INT16_MIN) 354 #define UINT_FAST16_MAX (UINT16_MAX) 355 #endif 356 #endif 357 358 #define INT_FAST32_MAX (INT32_MAX) 359 #define INT_FAST32_MIN (INT32_MIN) 360 #define UINT_FAST32_MAX (UINT32_MAX) 361 362 #if defined(__TMS320C55X__) || \ 363 (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) 364 #define INT_FAST40_MAX (INT40_MAX) 365 #define INT_FAST40_MIN (INT40_MIN) 366 #define UINT_FAST40_MAX (UINT40_MAX) 367 #endif 368 369 #if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 370 defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) 371 #define INT_FAST64_MAX (INT64_MAX) 372 #define INT_FAST64_MIN (INT64_MIN) 373 #define UINT_FAST64_MAX (UINT64_MAX) 374 #elif defined(__TMS320C2000__) 375 #if defined(__TMS320C28X__) || \ 376 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 377 #define INT_FAST64_MAX (INT64_MAX) 378 #define INT_FAST64_MIN (INT64_MIN) 379 #define UINT_FAST64_MAX (UINT64_MAX) 380 #endif 381 #endif 382 383 #if defined(__MSP430__) && !defined(__LARGE_CODE_MODEL__) 384 #define INTPTR_MAX (INT16_MAX) 385 #define INTPTR_MIN (INT16_MIN) 386 #define UINTPTR_MAX (UINT16_MAX) 387 #elif defined(__FROZEN__) 388 #define INTPTR_MAX (INT64_MAX) 389 #define INTPTR_MIN (INT64_MIN) 390 #define UINTPTR_MAX (UINT64_MAX) 391 #else 392 #define INTPTR_MAX (INT32_MAX) 393 #define INTPTR_MIN (INT32_MIN) 394 #define UINTPTR_MAX (UINT32_MAX) 395 #endif 396 397 #if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 398 defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) 399 #define INTMAX_MIN (INT64_MIN) 400 #define INTMAX_MAX (INT64_MAX) 401 #define UINTMAX_MAX (UINT64_MAX) 402 #elif defined(__TMS320C55X__) 403 #define INTMAX_MIN (INT40_MIN) 404 #define INTMAX_MAX (INT40_MAX) 405 #define UINTMAX_MAX (UINT40_MAX) 406 #elif defined(_TMS320C5XX) 407 #define INTMAX_MIN (INT32_MIN) 408 #define INTMAX_MAX (INT32_MAX) 409 #define UINTMAX_MAX (UINT32_MAX) 410 #elif defined(__TMS320C2000__) 411 #if defined(__TMS320C28X__) || \ 412 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 413 #define INTMAX_MIN (INT64_MIN) 414 #define INTMAX_MAX (INT64_MAX) 415 #define UINTMAX_MAX (UINT64_MAX) 416 #else 417 #define INTMAX_MIN (INT32_MIN) 418 #define INTMAX_MAX (INT32_MAX) 419 #define UINTMAX_MAX (UINT32_MAX) 420 #endif 421 #endif 422 423 /* 7.18.3 Limits of other integer types */ 424 425 #if defined(_TMS320C5XX) || defined(__TMS320C55X__) || \ 426 (defined(__MSP430__) && !defined(__LONG_PTRDIFF_T__)) 427 #define PTRDIFF_MAX (INT16_MAX) 428 #define PTRDIFF_MIN (INT16_MIN) 429 #elif defined(__TMS320C2000__) || defined(__MSP430__) || \ 430 (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) || \ 431 defined(__ARM_ARCH) || defined(__ARP32__) || defined(__PRU__) 432 #define PTRDIFF_MAX (INT32_MAX) 433 #define PTRDIFF_MIN (INT32_MIN) 434 #elif defined(__FROZEN__) 435 #define PTRDIFF_MAX (INT64_MAX) 436 #define PTRDIFF_MIN (INT64_MIN) 437 #endif 438 439 #if defined(_TMS320C5XX) || defined(__TMS320C55X__) || defined(__MSP430__) 440 #define SIG_ATOMIC_MIN (INT16_MIN) 441 #define SIG_ATOMIC_MAX (INT16_MAX) 442 #elif defined(__TMS320C2000__) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 443 defined(__ARM_ARCH) || defined(__ARP32__) || defined(__PRU__) 444 #define SIG_ATOMIC_MIN (INT32_MIN) 445 #define SIG_ATOMIC_MAX (INT32_MAX) 446 #endif 447 448 #if defined(_TMS320C5XX) || defined(__TMS320C55X__) || \ 449 (defined(__MSP430__) && !defined(__LONG_PTRDIFF_T__)) 450 #define SIZE_MAX (UINT16_MAX) 451 #elif defined(__TMS320C2000__) || defined(__MSP430__) || \ 452 (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) || \ 453 defined(__ARM_ARCH) || defined(__ARP32__) || defined(__PRU__) 454 #define SIZE_MAX (UINT32_MAX) 455 #elif defined(__FROZEN__) 456 #define SIZE_MAX (UINT64_MAX) 457 #endif 458 459 #ifndef WCHAR_MAX 460 #if !defined(__TI_WCHAR_T_BITS__) || __TI_WCHAR_T_BITS__ == 16 461 #define WCHAR_MAX 0xffffu 462 #else 463 #define WCHAR_MAX 0xffffffffu 464 #endif 465 #endif 466 467 #ifndef WCHAR_MIN 468 #define WCHAR_MIN 0 469 #endif 470 471 #if defined(_TMS320C5XX) || defined(__TMS320C55X__) || defined(__MSP430__) 472 #define WINT_MIN (INT16_MIN) 473 #define WINT_MAX (INT16_MAX) 474 #elif defined(__TMS320C2000__) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 475 defined(__ARM_ARCH) || defined(__ARP32__) || defined(__PRU__) 476 #define WINT_MIN (INT32_MIN) 477 #define WINT_MAX (INT32_MAX) 478 #endif 479 480 /* 7.18.4.1 Macros for minimum-width integer constants */ 481 482 /* 483 There is a defect report filed against the C99 standard concerning how 484 the (U)INTN_C macros should be implemented. Please refer to -- 485 http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/dr_209.htm 486 for more information. These macros are implemented according to the 487 suggestion given at this web site. 488 */ 489 490 #define INT8_C(value) ((int_least8_t)(value)) 491 #define UINT8_C(value) ((uint_least8_t)(value)) 492 #define INT16_C(value) ((int_least16_t)(value)) 493 #define UINT16_C(value) ((uint_least16_t)(value)) 494 #define INT32_C(value) ((int_least32_t)(value)) 495 #define UINT32_C(value) ((uint_least32_t)(value)) 496 497 #if defined(__TMS320C55X__) || \ 498 (defined(_TMS320C6X) && !defined(__C6X_MIGRATION__)) 499 #define INT40_C(value) ((int_least40_t)(value)) 500 #define UINT40_C(value) ((uint_least40_t)(value)) 501 #endif 502 503 #if defined(__ARM_ARCH) || defined(_TMS320C6X) || defined(__FROZEN__) || \ 504 defined(__ARP32__) || defined(__MSP430__) || defined(__PRU__) 505 #define INT64_C(value) ((int_least64_t)(value)) 506 #define UINT64_C(value) ((uint_least64_t)(value)) 507 #elif defined(__TMS320C2000__) 508 #if defined(__TMS320C28X__) || \ 509 (defined(__TMS320C28XX_CLA__) && defined(__TI_EABI__)) 510 #define INT64_C(value) ((int_least64_t)(value)) 511 #define UINT64_C(value) ((uint_least64_t)(value)) 512 #endif 513 #endif 514 515 /* 7.18.4.2 Macros for greatest-width integer constants */ 516 517 #define INTMAX_C(value) ((intmax_t)(value)) 518 #define UINTMAX_C(value) ((uintmax_t)(value)) 519 520 #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ 521 #endif 522 #endif /* _STDINT_H_ */ 523