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