/usr/lib/avr/include/stdint.h is in avr-libc 1:2.0.0+Atmel3.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 | /* Copyright (c) 2002,2004,2005 Marek Michalkiewicz
Copyright (c) 2005, Carlos Lamas
Copyright (c) 2005,2007 Joerg Wunsch
Copyright (c) 2013 Embecosm
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the copyright holders nor the names of
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. */
/* $Id$ */
/*
* ISO/IEC 9899:1999 7.18 Integer types <stdint.h>
*/
#ifndef __STDINT_H_
#define __STDINT_H_
/** \file */
/** \defgroup avr_stdint <stdint.h>: Standard Integer Types
\code #include <stdint.h> \endcode
Use [u]intN_t if you need exactly N bits.
Since these typedefs are mandated by the C99 standard, they are preferred
over rolling your own typedefs. */
#ifndef __DOXYGEN__
/*
* __USING_MINT8 is defined to 1 if the -mint8 option is in effect.
*/
#if __INT_MAX__ == 127
# define __USING_MINT8 1
#else
# define __USING_MINT8 0
#endif
#endif /* !__DOXYGEN__ */
/* Integer types */
#if defined(__DOXYGEN__)
/* doxygen gets confused by the __attribute__ stuff */
/** \name Exact-width integer types
Integer types having exactly the specified width */
/*@{*/
/** \ingroup avr_stdint
8-bit signed type. */
typedef signed char int8_t;
/** \ingroup avr_stdint
8-bit unsigned type. */
typedef unsigned char uint8_t;
/** \ingroup avr_stdint
16-bit signed type. */
typedef signed int int16_t;
/** \ingroup avr_stdint
16-bit unsigned type. */
typedef unsigned int uint16_t;
/** \ingroup avr_stdint
32-bit signed type. */
typedef signed long int int32_t;
/** \ingroup avr_stdint
32-bit unsigned type. */
typedef unsigned long int uint32_t;
/** \ingroup avr_stdint
64-bit signed type.
\note This type is not available when the compiler
option -mint8 is in effect. */
typedef signed long long int int64_t;
/** \ingroup avr_stdint
64-bit unsigned type.
\note This type is not available when the compiler
option -mint8 is in effect. */
typedef unsigned long long int uint64_t;
/*@}*/
#else /* !defined(__DOXYGEN__) */
/* actual implementation goes here */
typedef signed int int8_t __attribute__((__mode__(__QI__)));
typedef unsigned int uint8_t __attribute__((__mode__(__QI__)));
typedef signed int int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int uint16_t __attribute__ ((__mode__ (__HI__)));
typedef signed int int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int uint32_t __attribute__ ((__mode__ (__SI__)));
#if !__USING_MINT8
typedef signed int int64_t __attribute__((__mode__(__DI__)));
typedef unsigned int uint64_t __attribute__((__mode__(__DI__)));
#endif
#endif /* defined(__DOXYGEN__) */
/** \name Integer types capable of holding object pointers
These allow you to declare variables of the same size as a pointer. */
/*@{*/
/** \ingroup avr_stdint
Signed pointer compatible type. */
typedef int16_t intptr_t;
/** \ingroup avr_stdint
Unsigned pointer compatible type. */
typedef uint16_t uintptr_t;
/*@}*/
/** \name Minimum-width integer types
Integer types having at least the specified width */
/*@{*/
/** \ingroup avr_stdint
signed int with at least 8 bits. */
typedef int8_t int_least8_t;
/** \ingroup avr_stdint
unsigned int with at least 8 bits. */
typedef uint8_t uint_least8_t;
/** \ingroup avr_stdint
signed int with at least 16 bits. */
typedef int16_t int_least16_t;
/** \ingroup avr_stdint
unsigned int with at least 16 bits. */
typedef uint16_t uint_least16_t;
/** \ingroup avr_stdint
signed int with at least 32 bits. */
typedef int32_t int_least32_t;
/** \ingroup avr_stdint
unsigned int with at least 32 bits. */
typedef uint32_t uint_least32_t;
#if !__USING_MINT8 || defined(__DOXYGEN__)
/** \ingroup avr_stdint
signed int with at least 64 bits.
\note This type is not available when the compiler
option -mint8 is in effect. */
typedef int64_t int_least64_t;
/** \ingroup avr_stdint
unsigned int with at least 64 bits.
\note This type is not available when the compiler
option -mint8 is in effect. */
typedef uint64_t uint_least64_t;
#endif
/*@}*/
/** \name Fastest minimum-width integer types
Integer types being usually fastest having at least the specified width */
/*@{*/
/** \ingroup avr_stdint
fastest signed int with at least 8 bits. */
typedef int8_t int_fast8_t;
/** \ingroup avr_stdint
fastest unsigned int with at least 8 bits. */
typedef uint8_t uint_fast8_t;
/** \ingroup avr_stdint
fastest signed int with at least 16 bits. */
typedef int16_t int_fast16_t;
/** \ingroup avr_stdint
fastest unsigned int with at least 16 bits. */
typedef uint16_t uint_fast16_t;
/** \ingroup avr_stdint
fastest signed int with at least 32 bits. */
typedef int32_t int_fast32_t;
/** \ingroup avr_stdint
fastest unsigned int with at least 32 bits. */
typedef uint32_t uint_fast32_t;
#if !__USING_MINT8 || defined(__DOXYGEN__)
/** \ingroup avr_stdint
fastest signed int with at least 64 bits.
\note This type is not available when the compiler
option -mint8 is in effect. */
typedef int64_t int_fast64_t;
/** \ingroup avr_stdint
fastest unsigned int with at least 64 bits.
\note This type is not available when the compiler
option -mint8 is in effect. */
typedef uint64_t uint_fast64_t;
#endif
/*@}*/
/** \name Greatest-width integer types
Types designating integer data capable of representing any value of
any integer type in the corresponding signed or unsigned category */
/*@{*/
#if __USING_MINT8
typedef int32_t intmax_t;
typedef uint32_t uintmax_t;
#else /* !__USING_MINT8 */
/** \ingroup avr_stdint
largest signed int available. */
typedef int64_t intmax_t;
/** \ingroup avr_stdint
largest unsigned int available. */
typedef uint64_t uintmax_t;
#endif /* __USING_MINT8 */
/*@}*/
#ifndef __DOXYGEN__
/* Helping macro */
#ifndef __CONCAT
#define __CONCATenate(left, right) left ## right
#define __CONCAT(left, right) __CONCATenate(left, right)
#endif
#endif /* !__DOXYGEN__ */
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
/** \name Limits of specified-width integer types
C++ implementations should define these macros only when
__STDC_LIMIT_MACROS is defined before <stdint.h> is included */
/*@{*/
/** \ingroup avr_stdint
largest positive value an int8_t can hold. */
#define INT8_MAX 0x7f
/** \ingroup avr_stdint
smallest negative value an int8_t can hold. */
#define INT8_MIN (-INT8_MAX - 1)
#if __USING_MINT8
#define UINT8_MAX (__CONCAT(INT8_MAX, U) * 2U + 1U)
#define INT16_MAX 0x7fffL
#define INT16_MIN (-INT16_MAX - 1L)
#define UINT16_MAX (__CONCAT(INT16_MAX, U) * 2UL + 1UL)
#define INT32_MAX 0x7fffffffLL
#define INT32_MIN (-INT32_MAX - 1LL)
#define UINT32_MAX (__CONCAT(INT32_MAX, U) * 2ULL + 1ULL)
#else /* !__USING_MINT8 */
/** \ingroup avr_stdint
largest value an uint8_t can hold. */
#define UINT8_MAX (INT8_MAX * 2 + 1)
/** \ingroup avr_stdint
largest positive value an int16_t can hold. */
#define INT16_MAX 0x7fff
/** \ingroup avr_stdint
smallest negative value an int16_t can hold. */
#define INT16_MIN (-INT16_MAX - 1)
/** \ingroup avr_stdint
largest value an uint16_t can hold. */
#define UINT16_MAX (__CONCAT(INT16_MAX, U) * 2U + 1U)
/** \ingroup avr_stdint
largest positive value an int32_t can hold. */
#define INT32_MAX 0x7fffffffL
/** \ingroup avr_stdint
smallest negative value an int32_t can hold. */
#define INT32_MIN (-INT32_MAX - 1L)
/** \ingroup avr_stdint
largest value an uint32_t can hold. */
#define UINT32_MAX (__CONCAT(INT32_MAX, U) * 2UL + 1UL)
#endif /* __USING_MINT8 */
/** \ingroup avr_stdint
largest positive value an int64_t can hold. */
#define INT64_MAX 0x7fffffffffffffffLL
/** \ingroup avr_stdint
smallest negative value an int64_t can hold. */
#define INT64_MIN (-INT64_MAX - 1LL)
/** \ingroup avr_stdint
largest value an uint64_t can hold. */
#define UINT64_MAX (__CONCAT(INT64_MAX, U) * 2ULL + 1ULL)
/*@}*/
/** \name Limits of minimum-width integer types */
/*@{*/
/** \ingroup avr_stdint
largest positive value an int_least8_t can hold. */
#define INT_LEAST8_MAX INT8_MAX
/** \ingroup avr_stdint
smallest negative value an int_least8_t can hold. */
#define INT_LEAST8_MIN INT8_MIN
/** \ingroup avr_stdint
largest value an uint_least8_t can hold. */
#define UINT_LEAST8_MAX UINT8_MAX
/** \ingroup avr_stdint
largest positive value an int_least16_t can hold. */
#define INT_LEAST16_MAX INT16_MAX
/** \ingroup avr_stdint
smallest negative value an int_least16_t can hold. */
#define INT_LEAST16_MIN INT16_MIN
/** \ingroup avr_stdint
largest value an uint_least16_t can hold. */
#define UINT_LEAST16_MAX UINT16_MAX
/** \ingroup avr_stdint
largest positive value an int_least32_t can hold. */
#define INT_LEAST32_MAX INT32_MAX
/** \ingroup avr_stdint
smallest negative value an int_least32_t can hold. */
#define INT_LEAST32_MIN INT32_MIN
/** \ingroup avr_stdint
largest value an uint_least32_t can hold. */
#define UINT_LEAST32_MAX UINT32_MAX
/** \ingroup avr_stdint
largest positive value an int_least64_t can hold. */
#define INT_LEAST64_MAX INT64_MAX
/** \ingroup avr_stdint
smallest negative value an int_least64_t can hold. */
#define INT_LEAST64_MIN INT64_MIN
/** \ingroup avr_stdint
largest value an uint_least64_t can hold. */
#define UINT_LEAST64_MAX UINT64_MAX
/*@}*/
/** \name Limits of fastest minimum-width integer types */
/*@{*/
/** \ingroup avr_stdint
largest positive value an int_fast8_t can hold. */
#define INT_FAST8_MAX INT8_MAX
/** \ingroup avr_stdint
smallest negative value an int_fast8_t can hold. */
#define INT_FAST8_MIN INT8_MIN
/** \ingroup avr_stdint
largest value an uint_fast8_t can hold. */
#define UINT_FAST8_MAX UINT8_MAX
/** \ingroup avr_stdint
largest positive value an int_fast16_t can hold. */
#define INT_FAST16_MAX INT16_MAX
/** \ingroup avr_stdint
smallest negative value an int_fast16_t can hold. */
#define INT_FAST16_MIN INT16_MIN
/** \ingroup avr_stdint
largest value an uint_fast16_t can hold. */
#define UINT_FAST16_MAX UINT16_MAX
/** \ingroup avr_stdint
largest positive value an int_fast32_t can hold. */
#define INT_FAST32_MAX INT32_MAX
/** \ingroup avr_stdint
smallest negative value an int_fast32_t can hold. */
#define INT_FAST32_MIN INT32_MIN
/** \ingroup avr_stdint
largest value an uint_fast32_t can hold. */
#define UINT_FAST32_MAX UINT32_MAX
/** \ingroup avr_stdint
largest positive value an int_fast64_t can hold. */
#define INT_FAST64_MAX INT64_MAX
/** \ingroup avr_stdint
smallest negative value an int_fast64_t can hold. */
#define INT_FAST64_MIN INT64_MIN
/** \ingroup avr_stdint
largest value an uint_fast64_t can hold. */
#define UINT_FAST64_MAX UINT64_MAX
/*@}*/
/** \name Limits of integer types capable of holding object pointers */
/*@{*/
/** \ingroup avr_stdint
largest positive value an intptr_t can hold. */
#define INTPTR_MAX INT16_MAX
/** \ingroup avr_stdint
smallest negative value an intptr_t can hold. */
#define INTPTR_MIN INT16_MIN
/** \ingroup avr_stdint
largest value an uintptr_t can hold. */
#define UINTPTR_MAX UINT16_MAX
/*@}*/
/** \name Limits of greatest-width integer types */
/*@{*/
/** \ingroup avr_stdint
largest positive value an intmax_t can hold. */
#define INTMAX_MAX INT64_MAX
/** \ingroup avr_stdint
smallest negative value an intmax_t can hold. */
#define INTMAX_MIN INT64_MIN
/** \ingroup avr_stdint
largest value an uintmax_t can hold. */
#define UINTMAX_MAX UINT64_MAX
/*@}*/
/** \name Limits of other integer types
C++ implementations should define these macros only when
__STDC_LIMIT_MACROS is defined before <stdint.h> is included */
/*@{*/
/** \ingroup avr_stdint
largest positive value a ptrdiff_t can hold. */
#define PTRDIFF_MAX INT16_MAX
/** \ingroup avr_stdint
smallest negative value a ptrdiff_t can hold. */
#define PTRDIFF_MIN INT16_MIN
/* Limits of sig_atomic_t */
/* signal.h is currently not implemented (not avr/signal.h) */
/** \ingroup avr_stdint
largest positive value a sig_atomic_t can hold. */
#define SIG_ATOMIC_MAX INT8_MAX
/** \ingroup avr_stdint
smallest negative value a sig_atomic_t can hold. */
#define SIG_ATOMIC_MIN INT8_MIN
/** \ingroup avr_stdint
largest value a size_t can hold. */
#define SIZE_MAX UINT16_MAX
/* Limits of wchar_t */
/* wchar.h is currently not implemented */
/* #define WCHAR_MAX */
/* #define WCHAR_MIN */
/* Limits of wint_t */
/* wchar.h is currently not implemented */
#ifndef WCHAR_MAX
#define WCHAR_MAX __WCHAR_MAX__
#define WCHAR_MIN __WCHAR_MIN__
#endif
#ifndef WINT_MAX
#define WINT_MAX __WINT_MAX__
#define WINT_MIN __WINT_MIN__
#endif
#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
#if (!defined __cplusplus || __cplusplus >= 201103L \
|| defined __STDC_CONSTANT_MACROS)
/** \name Macros for integer constants
C++ implementations should define these macros only when
__STDC_CONSTANT_MACROS is defined before <stdint.h> is included.
These definitions are valid for integer constants without suffix and
for macros defined as integer constant without suffix */
/* The GNU C preprocessor defines special macros in the implementation
namespace to allow a definition that works in #if expressions. */
#ifdef __INT8_C
#define INT8_C(c) __INT8_C(c)
#define INT16_C(c) __INT16_C(c)
#define INT32_C(c) __INT32_C(c)
#define INT64_C(c) __INT64_C(c)
#define UINT8_C(c) __UINT8_C(c)
#define UINT16_C(c) __UINT16_C(c)
#define UINT32_C(c) __UINT32_C(c)
#define UINT64_C(c) __UINT64_C(c)
#define INTMAX_C(c) __INTMAX_C(c)
#define UINTMAX_C(c) __UINTMAX_C(c)
#else
/** \ingroup avr_stdint
define a constant of type int8_t */
#define INT8_C(value) ((int8_t) value)
/** \ingroup avr_stdint
define a constant of type uint8_t */
#define UINT8_C(value) ((uint8_t) __CONCAT(value, U))
#if __USING_MINT8
#define INT16_C(value) __CONCAT(value, L)
#define UINT16_C(value) __CONCAT(value, UL)
#define INT32_C(value) ((int32_t) __CONCAT(value, LL))
#define UINT32_C(value) ((uint32_t) __CONCAT(value, ULL))
#else /* !__USING_MINT8 */
/** \ingroup avr_stdint
define a constant of type int16_t */
#define INT16_C(value) value
/** \ingroup avr_stdint
define a constant of type uint16_t */
#define UINT16_C(value) __CONCAT(value, U)
/** \ingroup avr_stdint
define a constant of type int32_t */
#define INT32_C(value) __CONCAT(value, L)
/** \ingroup avr_stdint
define a constant of type uint32_t */
#define UINT32_C(value) __CONCAT(value, UL)
#endif /* __USING_MINT8 */
/** \ingroup avr_stdint
define a constant of type int64_t */
#define INT64_C(value) __CONCAT(value, LL)
/** \ingroup avr_stdint
define a constant of type uint64_t */
#define UINT64_C(value) __CONCAT(value, ULL)
/** \ingroup avr_stdint
define a constant of type intmax_t */
#define INTMAX_C(value) __CONCAT(value, LL)
/** \ingroup avr_stdint
define a constant of type uintmax_t */
#define UINTMAX_C(value) __CONCAT(value, ULL)
#endif /* !__INT8_C */
/*@}*/
#endif /* (!defined __cplusplus || __cplusplus >= 201103L \
|| defined __STDC_CONSTANT_MACROS) */
#endif /* _STDINT_H_ */
|