zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

inttypes.h (2427B) - Raw


      1 /*===---- inttypes.h - Standard header for integer printf macros ----------===*\
      2  *
      3  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
      4  * See https://llvm.org/LICENSE.txt for license information.
      5  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
      6  *
      7 \*===----------------------------------------------------------------------===*/
      8 
      9 #ifndef __CLANG_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 __CLANG_INTTYPES_H
     15 #endif
     16 #if defined(__MVS__) && __has_include_next(<inttypes.h>)
     17 #include_next <inttypes.h>
     18 #else
     19 
     20 #if defined(_MSC_VER) && _MSC_VER < 1800
     21 #error MSVC does not have inttypes.h prior to Visual Studio 2013
     22 #endif
     23 
     24 #include_next <inttypes.h>
     25 
     26 #if defined(_MSC_VER) && _MSC_VER < 1900
     27 /* MSVC headers define int32_t as int, but PRIx32 as "lx" instead of "x".
     28  * This triggers format warnings, so fix it up here. */
     29 #undef PRId32
     30 #undef PRIdLEAST32
     31 #undef PRIdFAST32
     32 #undef PRIi32
     33 #undef PRIiLEAST32
     34 #undef PRIiFAST32
     35 #undef PRIo32
     36 #undef PRIoLEAST32
     37 #undef PRIoFAST32
     38 #undef PRIu32
     39 #undef PRIuLEAST32
     40 #undef PRIuFAST32
     41 #undef PRIx32
     42 #undef PRIxLEAST32
     43 #undef PRIxFAST32
     44 #undef PRIX32
     45 #undef PRIXLEAST32
     46 #undef PRIXFAST32
     47 
     48 #undef SCNd32
     49 #undef SCNdLEAST32
     50 #undef SCNdFAST32
     51 #undef SCNi32
     52 #undef SCNiLEAST32
     53 #undef SCNiFAST32
     54 #undef SCNo32
     55 #undef SCNoLEAST32
     56 #undef SCNoFAST32
     57 #undef SCNu32
     58 #undef SCNuLEAST32
     59 #undef SCNuFAST32
     60 #undef SCNx32
     61 #undef SCNxLEAST32
     62 #undef SCNxFAST32
     63 
     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 
     83 #define SCNd32 "d"
     84 #define SCNdLEAST32 "d"
     85 #define SCNdFAST32 "d"
     86 #define SCNi32 "i"
     87 #define SCNiLEAST32 "i"
     88 #define SCNiFAST32 "i"
     89 #define SCNo32 "o"
     90 #define SCNoLEAST32 "o"
     91 #define SCNoFAST32 "o"
     92 #define SCNu32 "u"
     93 #define SCNuLEAST32 "u"
     94 #define SCNuFAST32 "u"
     95 #define SCNx32 "x"
     96 #define SCNxLEAST32 "x"
     97 #define SCNxFAST32 "x"
     98 #endif
     99 
    100 #endif /* __MVS__ */
    101 #endif /* __CLANG_INTTYPES_H */