Debian Codegraph @

share/libc/stdint.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 /* ISO C: 7.18 */
24 #ifndef __FC_STDINT
25 #define __FC_STDINT
26 #include "features.h"
27 __PUSH_FC_STDLIB
28 #include "__fc_machdep.h"
29
30 __BEGIN_DECLS
31
32 /* ISO C: 7.18.1.1 */
33 #ifdef __INT8_T
34 typedef __INT8_T int8_t;
35 #endif
36 #ifdef __UINT8_T
37 typedef __UINT8_T uint8_t;
38 #ifndef u_int8_t
39 #define u_int8_t uint8_t
40 #endif
41 #endif
42 #ifdef __INT16_T
43 typedef __INT16_T int16_t;
44 #endif
45 #ifdef __UINT16_T
46 typedef __UINT16_T uint16_t;
47 #ifndef u_int16_t
48 #define u_int16_t uint16_t
49 #endif
50 #endif
51 #ifdef __INT32_T
52 typedef __INT32_T int32_t;
53 #endif
54 #ifdef __UINT32_T
55 typedef __UINT32_T uint32_t;
56 #ifndef u_int32_t
57 #define u_int32_t uint32_t
58 #endif
59 #endif
60 #ifdef __INT64_T
61 typedef __INT64_T int64_t;
62 #endif
63 #ifdef __UINT64_T
64 typedef __UINT64_T uint64_t;
65 #ifndef u_int64_t
66 #define u_int64_t uint64_t
67 #endif
68 #endif
69
70 /* ISO C: 7.18.1.2 */
71 typedef __INT_LEAST8_T int_least8_t;
72 typedef __UINT_LEAST8_T uint_least8_t;
73 typedef __INT_LEAST16_T int_least16_t;
74 typedef __UINT_LEAST16_T uint_least16_t;
75 typedef __INT_LEAST32_T int_least32_t;
76 typedef __UINT_LEAST32_T uint_least32_t;
77 typedef __INT_LEAST64_T int_least64_t;
78 typedef __UINT_LEAST64_T uint_least64_t;
79
80 /* ISO C: 7.18.1.3 */
81 typedef __INT_FAST8_T int_fast8_t;
82 typedef __UINT_FAST8_T uint_fast8_t;
83 typedef __INT_FAST16_T int_fast16_t;
84 typedef __UINT_FAST16_T uint_fast16_t;
85 typedef __INT_FAST32_T int_fast32_t;
86 typedef __UINT_FAST32_T uint_fast32_t;
87 typedef __INT_FAST64_T int_fast64_t;
88 typedef __UINT_FAST64_T uint_fast64_t;
89
90 /* ISO C: 7.18.1.4 */
91 #include "__fc_define_intptr_t.h"
92
93 #ifdef __UINTPTR_T
94 typedef __UINTPTR_T uintptr_t;
95 #define UINTPTR_MAX __FC_UINTPTR_MAX
96 #endif
97
98 /* ISO C: 7.18.1.5 */
99 typedef __INT_MAX_T intmax_t;
100 typedef __UINT_MAX_T uintmax_t;
101
102 /* ISO C: 7.18.2.1 */
103 #define INT8_MIN (-128)
104 #define INT8_MAX 127
105 #define UINT8_MAX 255
106 #define INT16_MIN (-32768)
107 #define INT16_MAX 32767
108 #define UINT16_MAX 65535
109 #define INT32_MIN (-INT32_MAX - 1)
110 #define INT32_MAX 2147483647
111 #define UINT32_MAX 4294967295U
112 #define INT64_MIN (-INT64_MAX -1LL)
113 #define INT64_MAX 9223372036854775807LL
114 #define UINT64_MAX 18446744073709551615ULL
115
116 /* ISO C: 7.18.2.2 */
117 #define INT_LEAST8_MIN __INT_LEAST8_MIN
118 #define INT_LEAST8_MAX __INT_LEAST8_MAX
119 #define INT_LEAST16_MIN __INT_LEAST16_MIN
120 #define INT_LEAST16_MAX __INT_LEAST16_MAX
121 #define INT_LEAST32_MIN __INT_LEAST32_MIN
122 #define INT_LEAST32_MAX __INT_LEAST32_MAX
123 #define INT_LEAST64_MIN __INT_LEAST64_MIN
124 #define INT_LEAST64_MAX __INT_LEAST64_MAX
125
126 #define UINT_LEAST8_MAX __UINT_LEAST8_MAX
127 #define UINT_LEAST16_MAX __UINT_LEAST16_MAX
128 #define UINT_LEAST32_MAX __UINT_LEAST32_MAX
129 #define UINT_LEAST64_MAX __UINT_LEAST64_MAX
130
131 /* ISO C: 7.18.2.3 */
132
133 #define INT_FAST8_MIN __INT_FAST8_MIN
134 #define INT_FAST8_MAX __INT_FAST8_MAX
135 #define INT_FAST16_MIN __INT_FAST16_MIN
136 #define INT_FAST16_MAX __INT_FAST16_MAX
137 #define INT_FAST32_MIN __INT_FAST32_MIN
138 #define INT_FAST32_MAX __INT_FAST32_MAX
139 #define INT_FAST64_MIN __INT_FAST64_MIN
140 #define INT_FAST64_MAX __INT_FAST64_MAX
141
142 #define UINT_FAST8_MAX __UINT_FAST8_MAX
143 #define UINT_FAST16_MAX __UINT_FAST16_MAX
144 #define UINT_FAST32_MAX __UINT_FAST32_MAX
145 #define UINT_FAST64_MAX __UINT_FAST64_MAX
146
147 /* ISO C: 7.18.2.4 - Done directly with definition of corresponding types. */
148
149 /* ISO C: 7.18.2.5 */
150 #define INTMAX_MIN __FC_INTMAX_MIN
151 #define INTMAX_MAX __FC_INTMAX_MAX
152 #define UINTMAX_MAX __FC_UINTMAX_MAX
153
154 /* ISO C: 7.18.3 */
155
156 #define PTRDIFF_MIN __FC_PTRDIFF_MIN
157 #define PTRDIFF_MAX __FC_PTRDIFF_MAX
158 #define SIG_ATOMIC_MIN __FC_SIG_ATOMIC_MIN
159 #define SIG_ATOMIC_MAX __FC_SIG_ATOMIC_MAX
160 #define SIZE_MAX __FC_SIZE_MAX
161 #define WCHAR_MIN __FC_WCHAR_MIN
162 #define WCHAR_MAX __FC_WCHAR_MAX
163 #define WINT_MIN __FC_WINT_MIN
164 #define WINT_MAX __FC_WINT_MAX
165
166 /* ISO C: 7.18.4 */
167 #define INT8_C(c) c
168 #define UINT8_C(c) c
169 #define INT16_C(c) c
170 #define UINT16_C(c) c
171 #define INT32_C(c) (c ## L)
172 #define UINT32_C(c) (c ## UL)
173 #define INT64_C(c) (c ## LL)
174 #define UINT64_C(c) (c ## ULL)
175
176 #define INTMAX_C(c) (c ## LL)
177 #define UINTMAX_C(c) (c ## ULL)
178
179 __END_DECLS
180
181 __POP_FC_STDLIB
182 #endif