Skip to content

Commit f1f5220

Browse files
authored
[libc++] Only include the system <stdint.h> and <locale.h> if they exist (#115017)
Prior to aa7f377, we only did an #include_next of those system headers if they existed. After removing those headers from libc++, we started assuming that the system provided the headers because we unconditionally started including them. This patch fixes that.
1 parent e3a0775 commit f1f5220

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

libcxx/include/clocale

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ lconv* localeconv();
3636

3737
#include <__config>
3838

39-
#include <locale.h>
39+
#if __has_include(<locale.h>)
40+
# include <locale.h>
41+
#endif
4042

4143
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
4244
# pragma GCC system_header

libcxx/include/cstdint

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ Types:
142142

143143
#include <__config>
144144

145-
#include <stdint.h>
145+
#if __has_include(<stdint.h>)
146+
# include <stdint.h>
147+
#endif
146148

147149
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
148150
# pragma GCC system_header

0 commit comments

Comments
 (0)