#endif
#ifdef __cplusplus
-
-#include <ccomplex>
-
-#else // __cplusplus
-
-#include_next <complex.h>
-
-#endif // __cplusplus
+# include <ccomplex>
+#elif __has_include_next(<complex.h>)
+# include_next <complex.h>
+#endif
#endif // _LIBCPP_COMPLEX_H
# pragma GCC system_header
#endif
-#include_next <ctype.h>
+#if __has_include_next(<ctype.h>)
+# include_next <ctype.h>
+#endif
#ifdef __cplusplus
# pragma GCC system_header
#endif
-#include_next <errno.h>
+#if __has_include_next(<errno.h>)
+# include_next <errno.h>
+#endif
#ifdef __cplusplus
# pragma GCC system_header
#endif
-#include_next <fenv.h>
+#if __has_include_next(<fenv.h>)
+# include_next <fenv.h>
+#endif
#ifdef __cplusplus
# pragma GCC system_header
#endif
-#include_next <float.h>
+#if __has_include_next(<float.h>)
+# include_next <float.h>
+#endif
#ifdef __cplusplus
# define __STDC_FORMAT_MACROS
#endif
-#include_next <inttypes.h>
+#if __has_include_next(<inttypes.h>)
+# include_next <inttypes.h>
+#endif
#ifdef __cplusplus
#endif
#ifndef __GNUC__
-#include_next <limits.h>
+
+# if __has_include_next(<limits.h>)
+# include_next <limits.h>
+# endif
+
#else
// GCC header limits.h recursively includes itself through another header called
// syslimits.h for some reason. This setup breaks down if we directly
# pragma GCC system_header
#endif
-#include_next <locale.h>
+#if __has_include_next(<locale.h>)
+# include_next <locale.h>
+#endif
#endif // _LIBCPP_LOCALE_H
# pragma GCC system_header
#endif
-#include_next <math.h>
+# if __has_include_next(<math.h>)
+# include_next <math.h>
+# endif
#ifdef __cplusplus
# pragma GCC system_header
#endif
-#include_next <setjmp.h>
+#if __has_include_next(<setjmp.h>)
+# include_next <setjmp.h>
+#endif
#ifdef __cplusplus
# pragma GCC system_header
#endif
-#include_next <stdbool.h>
+#if __has_include_next(<stdbool.h>)
+# include_next <stdbool.h>
+#endif
#ifdef __cplusplus
#undef bool
# pragma GCC system_header
#endif
-#include_next <stddef.h>
+# if __has_include_next(<stddef.h>)
+# include_next <stddef.h>
+# endif
#ifdef __cplusplus
typedef decltype(nullptr) nullptr_t;
# define __STDC_CONSTANT_MACROS
#endif
-#include_next <stdint.h>
+#if __has_include_next(<stdint.h>)
+# include_next <stdint.h>
+#endif
#endif // _LIBCPP_STDINT_H
# pragma GCC system_header
#endif
-#include_next <stdio.h>
+# if __has_include_next(<stdio.h>)
+# include_next <stdio.h>
+# endif
#ifdef __cplusplus
# pragma GCC system_header
#endif
-#include_next <stdlib.h>
+# if __has_include_next(<stdlib.h>)
+# include_next <stdlib.h>
+# endif
#ifdef __cplusplus
extern "C++" {
# pragma GCC system_header
#endif
-#include_next <string.h>
+#if __has_include_next(<string.h>)
+# include_next <string.h>
+#endif
// MSVCRT, GNU libc and its derivates may already have the correct prototype in
// <string.h>. This macro can be defined by users if their C library provides
#endif
#ifdef __cplusplus
-
-#include <ctgmath>
-
-#else // __cplusplus
-
-#include_next <tgmath.h>
-
-#endif // __cplusplus
+# include <ctgmath>
+#else
+# if __has_include_next(<tgmath.h>)
+# include_next <tgmath.h>
+# endif
+#endif
#endif // _LIBCPP_TGMATH_H
#define __CORRECT_ISO_CPP_WCHAR_H_PROTO
#endif
-#include_next <wchar.h>
+# if __has_include_next(<wchar.h>)
+# include_next <wchar.h>
+# endif
// Determine whether we have const-correct overloads for wcschr and friends.
#if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)