diff --git a/clang/lib/Headers/inttypes.h b/clang/lib/Headers/inttypes.h --- a/clang/lib/Headers/inttypes.h +++ b/clang/lib/Headers/inttypes.h @@ -21,7 +21,11 @@ \*===----------------------------------------------------------------------===*/ #ifndef __CLANG_INTTYPES_H +// AIX system headers need stdint.h to be re-enterable if _STD_TYPES_T +// 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 --- a/clang/lib/Headers/stdint.h +++ b/clang/lib/Headers/stdint.h @@ -23,7 +23,11 @@ \*===----------------------------------------------------------------------===*/ #ifndef __CLANG_STDINT_H +// AIX system headers need stdint.h to be re-enterable if _STD_TYPES_T +// 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. diff --git a/libcxx/include/inttypes.h b/libcxx/include/inttypes.h --- a/libcxx/include/inttypes.h +++ b/libcxx/include/inttypes.h @@ -8,7 +8,11 @@ //===----------------------------------------------------------------------===// #ifndef _LIBCPP_INTTYPES_H +// AIX system headers need inttypes.h to be re-enterable if _STD_TYPES_T +// is defined. +#if !defined(_AIX) || !defined(_STD_TYPES_T) #define _LIBCPP_INTTYPES_H +#endif // _STD_TYPES_T /* inttypes.h synopsis diff --git a/libcxx/include/stdint.h b/libcxx/include/stdint.h --- a/libcxx/include/stdint.h +++ b/libcxx/include/stdint.h @@ -8,7 +8,11 @@ //===----------------------------------------------------------------------===// #ifndef _LIBCPP_STDINT_H +// AIX system headers need stdint.h to be re-enterable if _STD_TYPES_T +// is defined. +#if !defined(_AIX) || !defined(_STD_TYPES_T) #define _LIBCPP_STDINT_H +#endif // _STD_TYPES_T /* stdint.h synopsis