inttypes.h 3.8 KB

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