stdc.library: add missing defines to stdint.h
[AROS.git] / compiler / stdc / include / aros / stdc / stdint.h
blob2739571ef9190509249a05a3e9b81e6b404689e7
1 #ifndef _STDC_STDINT_H_
2 #define _STDC_STDINT_H_
4 /*
5 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: C99 header file stdint.h
9 Standard fixed sized integral types.
12 #include <aros/cpu.h>
14 #include <aros/types/int_t.h>
16 #include <aros/types/intptr_t.h>
17 #include <aros/types/uintptr_t.h>
20 #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
22 #define INT8_MIN (-128)
23 #define INT16_MIN (-32767-1)
24 #define INT32_MIN (-2147483647-1)
25 #define INT64_MIN (-AROS_MAKE_INT64(9223372036854775807)-1)
27 #define INT8_MAX (127)
28 #define INT16_MAX (32767)
29 #define INT32_MAX (2147483647)
30 #define INT64_MAX (AROS_MAKE_INT64(9223372036854775807))
32 #define UINT8_MAX (255)
33 #define UINT16_MAX (65535)
34 #define UINT32_MAX (4294967295U)
35 #define UINT64_MAX (AROS_MAKE_UINT64(18446744073709551615))
37 #define SIG_ATOMIC_MIN AROS_SIG_ATOMIC_MIN
38 #define SIG_ATOMIC_MAX AROS_SIG_ATOMIC_MAX
40 #define INT_LEAST8_MIN (-128)
41 #define INT_LEAST16_MIN (-32767-1)
42 #define INT_LEAST32_MIN (-2147483647-1)
43 #define INT_LEAST64_MIN (-AROS_MAKE_INT64(9223372036854775807)-1)
45 #define INT_LEAST8_MAX (127)
46 #define INT_LEAST16_MAX (32767)
47 #define INT_LEAST32_MAX (2147483647)
48 #define INT_LEAST64_MAX (AROS_MAKE_INT64(9223372036854775807))
50 #define UINT_LEAST8_MAX (255)
51 #define UINT_LEAST16_MAX (65535)
52 #define UINT_LEAST32_MAX (4294967295U)
53 #define UINT_LEAST64_MAX (AROS_MAKE_UINT64(18446744073709551615))
56 #define INT_FAST8_MIN (-128)
57 #define INT_FAST16_MIN (-32767-1)
58 #define INT_FAST32_MIN (-2147483647-1)
59 #define INT_FAST64_MIN (-AROS_MAKE_INT64(9223372036854775807)-1)
61 #define INT_FAST8_MAX (127)
62 #define INT_FAST16_MAX (32767)
63 #define INT_FAST32_MAX (2147483647)
64 #define INT_FAST64_MAX (AROS_MAKE_INT64(9223372036854775807))
66 #define UINT_FAST8_MAX (255)
67 #define UINT_FAST16_MAX (65535)
68 #define UINT_FAST32_MAX (4294967295U)
69 #define UINT_FAST64_MAX (AROS_MAKE_UINT64(18446744073709551615))
72 #if __WORDSIZE == 64
73 #define INTPTR_MIN (-AROS_MAKE_INT64(9223372036854775807)-1)
74 #define INTPTR_MAX (AROS_MAKE_INT64(9223372036854775807))
75 #define UINTPTR_MAX (AROS_MAKE_UINT64(18446744073709551615))
76 #else
77 #define INTPTR_MIN (-2147483647-1)
78 #define INTPTR_MAX (2147483647)
79 #define UINTPTR_MAX (4294967295U)
80 #endif
82 /* TODO:
83 PTRDIFF_MIN, _MAX
84 SIZE_MAX
85 WCHAR_MIN, _MAX (must be <= -127 or >= 127)
86 WINT_MIN, _MAX (must be <= -65535 or >= 65535)
89 #endif
92 #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
94 /* Signed. */
95 # define INT8_C(c) c
96 # define INT16_C(c) c
97 # define INT32_C(c) c
98 # if __WORDSIZE == 64
99 # define INT64_C(c) c ## L
100 # else
101 # define INT64_C(c) c ## LL
102 # endif
104 /* Unsigned. */
105 # define UINT8_C(c) c
106 # define UINT16_C(c) c
107 # define UINT32_C(c) c ## U
108 # if __WORDSIZE == 64
109 # define UINT64_C(c) c ## UL
110 # else
111 # define UINT64_C(c) c ## ULL
112 # endif
114 /* Maximal type. */
115 # if __WORDSIZE == 64
116 # define INTMAX_C(c) c ## L
117 # define UINTMAX_C(c) c ## UL
118 # else
119 # define INTMAX_C(c) c ## LL
120 # define UINTMAX_C(c) c ## ULL
121 # endif
123 /* Maximal integer (long long) size */
124 # define INTMAX_MIN INT64_MIN
125 # define INTMAX_MAX INT64_MAX
127 /* Maximal unsigned integer (unsigned long long) size */
128 # define UINTMAX_MAX UINT64_MAX
130 #endif /* !__cplusplus || __STDC_CONSTANT_MACROS */
132 #endif /* _STDC_STDINT_H_ */