102 lines · c
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-exception6 *7\*===----------------------------------------------------------------------===*/8 9#ifndef __CLANG_INTTYPES_H10// AIX system headers need inttypes.h to be re-enterable while _STD_TYPES_T11// is defined until an inclusion of it without _STD_TYPES_T occurs, in which12// case the header guard macro is defined.13#if !defined(_AIX) || !defined(_STD_TYPES_T)14#define __CLANG_INTTYPES_H15#endif16#if defined(__MVS__) && __has_include_next(<inttypes.h>)17#include_next <inttypes.h>18#else19 20#if defined(_MSC_VER) && _MSC_VER < 180021#error MSVC does not have inttypes.h prior to Visual Studio 201322#endif23 24#include_next <inttypes.h>25 26#if defined(_MSC_VER) && _MSC_VER < 190027/* 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 PRId3230#undef PRIdLEAST3231#undef PRIdFAST3232#undef PRIi3233#undef PRIiLEAST3234#undef PRIiFAST3235#undef PRIo3236#undef PRIoLEAST3237#undef PRIoFAST3238#undef PRIu3239#undef PRIuLEAST3240#undef PRIuFAST3241#undef PRIx3242#undef PRIxLEAST3243#undef PRIxFAST3244#undef PRIX3245#undef PRIXLEAST3246#undef PRIXFAST3247 48#undef SCNd3249#undef SCNdLEAST3250#undef SCNdFAST3251#undef SCNi3252#undef SCNiLEAST3253#undef SCNiFAST3254#undef SCNo3255#undef SCNoLEAST3256#undef SCNoFAST3257#undef SCNu3258#undef SCNuLEAST3259#undef SCNuFAST3260#undef SCNx3261#undef SCNxLEAST3262#undef SCNxFAST3263 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#endif99 100#endif /* __MVS__ */101#endif /* __CLANG_INTTYPES_H */102