inttypes.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*===---- inttypes.h - Standard header for integer printf macros ----------===*\
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to deal
  5. * in the Software without restriction, including without limitation the rights
  6. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. * copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. * THE SOFTWARE.
  20. *
  21. \*===----------------------------------------------------------------------===*/
  22. #ifndef __CLANG_INTTYPES_H
  23. #define __CLANG_INTTYPES_H
  24. #if defined(_MSC_VER) && _MSC_VER < 1800
  25. #error MSVC does not have inttypes.h prior to Visual Studio 2013
  26. #endif
  27. #include_next <inttypes.h>
  28. #if defined(_MSC_VER) && _MSC_VER < 1900
  29. /* MSVC headers define int32_t as int, but PRIx32 as "lx" instead of "x".
  30. * This triggers format warnings, so fix it up here. */
  31. #undef PRId32
  32. #undef PRIdLEAST32
  33. #undef PRIdFAST32
  34. #undef PRIi32
  35. #undef PRIiLEAST32
  36. #undef PRIiFAST32
  37. #undef PRIo32
  38. #undef PRIoLEAST32
  39. #undef PRIoFAST32
  40. #undef PRIu32
  41. #undef PRIuLEAST32
  42. #undef PRIuFAST32
  43. #undef PRIx32
  44. #undef PRIxLEAST32
  45. #undef PRIxFAST32
  46. #undef PRIX32
  47. #undef PRIXLEAST32
  48. #undef PRIXFAST32
  49. #undef SCNd32
  50. #undef SCNdLEAST32
  51. #undef SCNdFAST32
  52. #undef SCNi32
  53. #undef SCNiLEAST32
  54. #undef SCNiFAST32
  55. #undef SCNo32
  56. #undef SCNoLEAST32
  57. #undef SCNoFAST32
  58. #undef SCNu32
  59. #undef SCNuLEAST32
  60. #undef SCNuFAST32
  61. #undef SCNx32
  62. #undef SCNxLEAST32
  63. #undef SCNxFAST32
  64. #define PRId32 "d"
  65. #define PRIdLEAST32 "d"
  66. #define PRIdFAST32 "d"
  67. #define PRIi32 "i"
  68. #define PRIiLEAST32 "i"
  69. #define PRIiFAST32 "i"
  70. #define PRIo32 "o"
  71. #define PRIoLEAST32 "o"
  72. #define PRIoFAST32 "o"
  73. #define PRIu32 "u"
  74. #define PRIuLEAST32 "u"
  75. #define PRIuFAST32 "u"
  76. #define PRIx32 "x"
  77. #define PRIxLEAST32 "x"
  78. #define PRIxFAST32 "x"
  79. #define PRIX32 "X"
  80. #define PRIXLEAST32 "X"
  81. #define PRIXFAST32 "X"
  82. #define SCNd32 "d"
  83. #define SCNdLEAST32 "d"
  84. #define SCNdFAST32 "d"
  85. #define SCNi32 "i"
  86. #define SCNiLEAST32 "i"
  87. #define SCNiFAST32 "i"
  88. #define SCNo32 "o"
  89. #define SCNoLEAST32 "o"
  90. #define SCNoFAST32 "o"
  91. #define SCNu32 "u"
  92. #define SCNuLEAST32 "u"
  93. #define SCNuFAST32 "u"
  94. #define SCNx32 "x"
  95. #define SCNxLEAST32 "x"
  96. #define SCNxFAST32 "x"
  97. #endif
  98. #endif /* __CLANG_INTTYPES_H */