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 | ab4bcd844ab9df699c7f396786dc114f85ab8c45 (patch) | |
tree | 390c583d649faba0ec372e0ff90ac929813738da /clang/lib/Headers | |
parent | 345473c791080ff74a37e748a76f6d0d3ef27cf2 (diff) | |
download | bcm5719-llvm-ab4bcd844ab9df699c7f396786dc114f85ab8c45.tar.gz bcm5719-llvm-ab4bcd844ab9df699c7f396786dc114f85ab8c45.zip |
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
llvm-svn: 363939
Diffstat (limited to 'clang/lib/Headers')
-rw-r--r-- | clang/lib/Headers/inttypes.h | 5 | ||||
-rw-r--r-- | clang/lib/Headers/stdint.h | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Headers/inttypes.h b/clang/lib/Headers/inttypes.h index cd2c70a5316..1c894c4aca4 100644 --- a/clang/lib/Headers/inttypes.h +++ b/clang/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/clang/lib/Headers/stdint.h b/clang/lib/Headers/stdint.h index 47fc97670f1..192f653e95a 100644 --- a/clang/lib/Headers/stdint.h +++ b/clang/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. |