xingxue created this revision.
xingxue added reviewers: hubert.reinterpretcast, jasonliu, mclow.lists.
xingxue added a project: LLVM.
Herald added a reviewer: EricWF.
Herald added subscribers: libcxx-commits, cfe-commits, christof.
Herald added projects: clang, libc++.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D59253

Files:
  clang/lib/Headers/inttypes.h
  clang/lib/Headers/stdint.h
  libcxx/include/inttypes.h
  libcxx/include/stdint.h


Index: libcxx/include/stdint.h
===================================================================
--- libcxx/include/stdint.h
+++ 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
Index: libcxx/include/inttypes.h
===================================================================
--- libcxx/include/inttypes.h
+++ 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
Index: clang/lib/Headers/stdint.h
===================================================================
--- clang/lib/Headers/stdint.h
+++ 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.
Index: clang/lib/Headers/inttypes.h
===================================================================
--- clang/lib/Headers/inttypes.h
+++ 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


Index: libcxx/include/stdint.h
===================================================================
--- libcxx/include/stdint.h
+++ 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
Index: libcxx/include/inttypes.h
===================================================================
--- libcxx/include/inttypes.h
+++ 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
Index: clang/lib/Headers/stdint.h
===================================================================
--- clang/lib/Headers/stdint.h
+++ 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.
Index: clang/lib/Headers/inttypes.h
===================================================================
--- clang/lib/Headers/inttypes.h
+++ 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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D59253: [AIX][libcxx... Xing Xue via Phabricator via cfe-commits

Reply via email to