From: Xing Xue Date: Thu, 20 Jun 2019 15:36:32 +0000 (+0000) Subject: AIX system headers need stdint.h and inttypes.h to be re-enterable X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b4099d3849be7f3a2c3197a5f4a80a5c5569051;p=clang AIX system headers need stdint.h and inttypes.h to be re-enterable Summary: AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined so that limit macro definitions such as UINT32_MAX can be found. This patch attempts to allow that on AIX. Reviewers: hubert.reinterpretcast, jasonliu, mclow.lists, EricWF Reviewed by: hubert.reinterpretcast, mclow.lists Subscribers: jfb, jsji, christof, cfe-commits, libcxx-commits, llvm-commits Tags: #LLVM, #clang, #libc++ Differential Revision: https://reviews.llvm.org/D59253 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363939 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/inttypes.h b/lib/Headers/inttypes.h index cd2c70a531..1c894c4aca 100644 --- a/lib/Headers/inttypes.h +++ b/lib/Headers/inttypes.h @@ -7,7 +7,12 @@ \*===----------------------------------------------------------------------===*/ #ifndef __CLANG_INTTYPES_H +// AIX system headers need inttypes.h to be re-enterable while _STD_TYPES_T +// is defined until an inclusion of it without _STD_TYPES_T occurs, in which +// case the header guard macro is defined. +#if !defined(_AIX) || !defined(_STD_TYPES_T) #define __CLANG_INTTYPES_H +#endif #if defined(_MSC_VER) && _MSC_VER < 1800 #error MSVC does not have inttypes.h prior to Visual Studio 2013 diff --git a/lib/Headers/stdint.h b/lib/Headers/stdint.h index 47fc97670f..192f653e95 100644 --- a/lib/Headers/stdint.h +++ b/lib/Headers/stdint.h @@ -7,7 +7,12 @@ \*===----------------------------------------------------------------------===*/ #ifndef __CLANG_STDINT_H +// AIX system headers need stdint.h to be re-enterable while _STD_TYPES_T +// is defined until an inclusion of it without _STD_TYPES_T occurs, in which +// case the header guard macro is defined. +#if !defined(_AIX) || !defined(_STD_TYPES_T) || !defined(__STDC_HOSTED__) #define __CLANG_STDINT_H +#endif /* If we're hosted, fall back to the system's stdint.h, which might have * additional definitions.