diff options
author | Xing Xue <xingxue@outlook.com> | 2019-06-20 15:36:32 +0000 |
---|---|---|
committer | Xing Xue <xingxue@outlook.com> | 2019-06-20 15:36:32 +0000 |
commit | 0b4099d3849be7f3a2c3197a5f4a80a5c5569051 (patch) | |
tree | d1a3d5e5b9d561c24823bc471bcca0d7c9cb71c0 | |
parent | 2eca76d86f4e9f5f82719c7fb09f79b5dea84f87 (diff) | |
download | clang-0b4099d3849be7f3a2c3197a5f4a80a5c5569051.tar.gz |
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
-rw-r--r-- | lib/Headers/inttypes.h | 5 | ||||
-rw-r--r-- | lib/Headers/stdint.h | 5 |
2 files changed, 10 insertions, 0 deletions
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. |