1// -*- C++ -*-
2//===--------------------------- inttypes.h -------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_INTTYPES_H
11// AIX system headers need inttypes.h to be re-enterable while _STD_TYPES_T
12// is defined until an inclusion of it without _STD_TYPES_T occurs, in which
13// case the header guard macro is defined.
14#if !defined(_AIX) || !defined(_STD_TYPES_T)
15#define _LIBCPP_INTTYPES_H
16#endif // _STD_TYPES_T
17
18/*
19 inttypes.h synopsis
20
21This entire header is C99 / C++0X
22
23#include <stdint.h> // <cinttypes> includes <cstdint>
24
25Macros:
26
27 PRId8
28 PRId16
29 PRId32
30 PRId64
31
32 PRIdLEAST8
33 PRIdLEAST16
34 PRIdLEAST32
35 PRIdLEAST64
36
37 PRIdFAST8
38 PRIdFAST16
39 PRIdFAST32
40 PRIdFAST64
41
42 PRIdMAX
43 PRIdPTR
44
45 PRIi8
46 PRIi16
47 PRIi32
48 PRIi64
49
50 PRIiLEAST8
51 PRIiLEAST16
52 PRIiLEAST32
53 PRIiLEAST64
54
55 PRIiFAST8
56 PRIiFAST16
57 PRIiFAST32
58 PRIiFAST64
59
60 PRIiMAX
61 PRIiPTR
62
63 PRIo8
64 PRIo16
65 PRIo32
66 PRIo64
67
68 PRIoLEAST8
69 PRIoLEAST16
70 PRIoLEAST32
71 PRIoLEAST64
72
73 PRIoFAST8
74 PRIoFAST16
75 PRIoFAST32
76 PRIoFAST64
77
78 PRIoMAX
79 PRIoPTR
80
81 PRIu8
82 PRIu16
83 PRIu32
84 PRIu64
85
86 PRIuLEAST8
87 PRIuLEAST16
88 PRIuLEAST32
89 PRIuLEAST64
90
91 PRIuFAST8
92 PRIuFAST16
93 PRIuFAST32
94 PRIuFAST64
95
96 PRIuMAX
97 PRIuPTR
98
99 PRIx8
100 PRIx16
101 PRIx32
102 PRIx64
103
104 PRIxLEAST8
105 PRIxLEAST16
106 PRIxLEAST32
107 PRIxLEAST64
108
109 PRIxFAST8
110 PRIxFAST16
111 PRIxFAST32
112 PRIxFAST64
113
114 PRIxMAX
115 PRIxPTR
116
117 PRIX8
118 PRIX16
119 PRIX32
120 PRIX64
121
122 PRIXLEAST8
123 PRIXLEAST16
124 PRIXLEAST32
125 PRIXLEAST64
126
127 PRIXFAST8
128 PRIXFAST16
129 PRIXFAST32
130 PRIXFAST64
131
132 PRIXMAX
133 PRIXPTR
134
135 SCNd8
136 SCNd16
137 SCNd32
138 SCNd64
139
140 SCNdLEAST8
141 SCNdLEAST16
142 SCNdLEAST32
143 SCNdLEAST64
144
145 SCNdFAST8
146 SCNdFAST16
147 SCNdFAST32
148 SCNdFAST64
149
150 SCNdMAX
151 SCNdPTR
152
153 SCNi8
154 SCNi16
155 SCNi32
156 SCNi64
157
158 SCNiLEAST8
159 SCNiLEAST16
160 SCNiLEAST32
161 SCNiLEAST64
162
163 SCNiFAST8
164 SCNiFAST16
165 SCNiFAST32
166 SCNiFAST64
167
168 SCNiMAX
169 SCNiPTR
170
171 SCNo8
172 SCNo16
173 SCNo32
174 SCNo64
175
176 SCNoLEAST8
177 SCNoLEAST16
178 SCNoLEAST32
179 SCNoLEAST64
180
181 SCNoFAST8
182 SCNoFAST16
183 SCNoFAST32
184 SCNoFAST64
185
186 SCNoMAX
187 SCNoPTR
188
189 SCNu8
190 SCNu16
191 SCNu32
192 SCNu64
193
194 SCNuLEAST8
195 SCNuLEAST16
196 SCNuLEAST32
197 SCNuLEAST64
198
199 SCNuFAST8
200 SCNuFAST16
201 SCNuFAST32
202 SCNuFAST64
203
204 SCNuMAX
205 SCNuPTR
206
207 SCNx8
208 SCNx16
209 SCNx32
210 SCNx64
211
212 SCNxLEAST8
213 SCNxLEAST16
214 SCNxLEAST32
215 SCNxLEAST64
216
217 SCNxFAST8
218 SCNxFAST16
219 SCNxFAST32
220 SCNxFAST64
221
222 SCNxMAX
223 SCNxPTR
224
225Types:
226
227 imaxdiv_t
228
229intmax_t imaxabs(intmax_t j);
230imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
231intmax_t strtoimax(const char* restrict nptr, char** restrict endptr, int base);
232uintmax_t strtoumax(const char* restrict nptr, char** restrict endptr, int base);
233intmax_t wcstoimax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
234uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
235
236*/
237
238#include <__config>
239
240#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
241#pragma GCC system_header
242#endif
243
244/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
245 for C++11 unless __STDC_FORMAT_MACROS is defined
246*/
247#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
248# define __STDC_FORMAT_MACROS
249#endif
250
251#include_next <inttypes.h>
252
253#ifdef __cplusplus
254
255#include <stdint.h>
256
257#undef imaxabs
258#undef imaxdiv
259
260#endif // __cplusplus
261
262#endif // _LIBCPP_INTTYPES_H
263