[PATCH] D59253: [AIX][libcxx] AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined
Xing Xue via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 07:12:38 PDT 2019
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59253.190250.patch
Type: text/x-patch
Size: 2179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190312/cd578e97/attachment.bin>
More information about the llvm-commits
mailing list