AVR-LibC  2.3.0
Standard C library for AVR-GCC
 

AVR-LibC Manual

AVR-LibC Sources

Main Page

User Manual

Lib­rary Refe­rence

FAQ

Exam­ple Pro­jects

Index

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