[libcxx-commits] [libcxx] [libc++][C++03] Remove some of the C++03-specific C wrapper headers (PR #163772)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 20 04:47:56 PDT 2025


https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/163772

>From 51f55faf8f0210f6b67bad876c53223b1834f901 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Thu, 16 Oct 2025 15:06:44 +0200
Subject: [PATCH] [libc++][C++03] Remove some of the C++03-specific C wrapper
 headers

---
 libcxx/include/CMakeLists.txt                 |  11 -
 .../__cxx03/__thread/support/pthread.h        |   2 +-
 libcxx/include/__cxx03/cctype                 |   4 +-
 libcxx/include/__cxx03/cerrno                 |   4 +-
 libcxx/include/__cxx03/cfenv                  |   4 +-
 libcxx/include/__cxx03/cfloat                 |   4 +-
 libcxx/include/__cxx03/cinttypes              |   4 +-
 libcxx/include/__cxx03/complex.h              |  32 --
 libcxx/include/__cxx03/cstddef                |   4 +-
 libcxx/include/__cxx03/cstdio                 |   4 +-
 libcxx/include/__cxx03/ctype.h                |  61 --
 libcxx/include/__cxx03/cwctype                |   4 +-
 libcxx/include/__cxx03/errno.h                | 399 -------------
 libcxx/include/__cxx03/ext/__hash             |   2 +-
 libcxx/include/__cxx03/fenv.h                 | 114 ----
 libcxx/include/__cxx03/float.h                |  95 ----
 libcxx/include/__cxx03/inttypes.h             | 264 ---------
 libcxx/include/__cxx03/stdbool.h              |  40 --
 libcxx/include/__cxx03/stddef.h               |  44 --
 libcxx/include/__cxx03/stdio.h                | 123 ----
 libcxx/include/__cxx03/tgmath.h               |  34 --
 libcxx/include/__cxx03/wchar.h                |   2 +-
 libcxx/include/__cxx03/wctype.h               |  95 ----
 libcxx/include/complex.h                      |  20 +-
 libcxx/include/ctype.h                        |  48 +-
 libcxx/include/errno.h                        | 538 +++++++++---------
 libcxx/include/fenv.h                         |  86 +--
 libcxx/include/float.h                        |  32 +-
 libcxx/include/inttypes.h                     |  32 +-
 libcxx/include/stdbool.h                      |  36 +-
 libcxx/include/stddef.h                       |  20 +-
 libcxx/include/stdio.h                        |  41 +-
 libcxx/include/tgmath.h                       |  24 +-
 libcxx/include/wctype.h                       |  58 +-
 34 files changed, 486 insertions(+), 1799 deletions(-)
 delete mode 100644 libcxx/include/__cxx03/complex.h
 delete mode 100644 libcxx/include/__cxx03/ctype.h
 delete mode 100644 libcxx/include/__cxx03/errno.h
 delete mode 100644 libcxx/include/__cxx03/fenv.h
 delete mode 100644 libcxx/include/__cxx03/float.h
 delete mode 100644 libcxx/include/__cxx03/inttypes.h
 delete mode 100644 libcxx/include/__cxx03/stdbool.h
 delete mode 100644 libcxx/include/__cxx03/stddef.h
 delete mode 100644 libcxx/include/__cxx03/stdio.h
 delete mode 100644 libcxx/include/__cxx03/tgmath.h
 delete mode 100644 libcxx/include/__cxx03/wctype.h

diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index ddace8bf8c728..2c175e3b1c125 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -1594,7 +1594,6 @@ set(files
   __cxx03/cmath
   __cxx03/codecvt
   __cxx03/complex
-  __cxx03/complex.h
   __cxx03/condition_variable
   __cxx03/csetjmp
   __cxx03/csignal
@@ -1607,25 +1606,20 @@ set(files
   __cxx03/cstring
   __cxx03/ctgmath
   __cxx03/ctime
-  __cxx03/ctype.h
   __cxx03/cuchar
   __cxx03/cwchar
   __cxx03/cwctype
   __cxx03/deque
-  __cxx03/errno.h
   __cxx03/exception
   __cxx03/experimental/__config
   __cxx03/experimental/utility
   __cxx03/ext/__hash
   __cxx03/ext/hash_map
   __cxx03/ext/hash_set
-  __cxx03/fenv.h
-  __cxx03/float.h
   __cxx03/forward_list
   __cxx03/fstream
   __cxx03/functional
   __cxx03/future
-  __cxx03/inttypes.h
   __cxx03/iomanip
   __cxx03/ios
   __cxx03/iosfwd
@@ -1652,11 +1646,8 @@ set(files
   __cxx03/sstream
   __cxx03/stack
   __cxx03/stdatomic.h
-  __cxx03/stdbool.h
-  __cxx03/stddef.h
   __cxx03/stdexcept
   __cxx03/stdint.h
-  __cxx03/stdio.h
   __cxx03/stdlib.h
   __cxx03/streambuf
   __cxx03/string
@@ -1664,7 +1655,6 @@ set(files
   __cxx03/string_view
   __cxx03/strstream
   __cxx03/system_error
-  __cxx03/tgmath.h
   __cxx03/thread
   __cxx03/type_traits
   __cxx03/typeindex
@@ -1677,7 +1667,6 @@ set(files
   __cxx03/vector
   __cxx03/version
   __cxx03/wchar.h
-  __cxx03/wctype.h
   )
 
 configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY)
diff --git a/libcxx/include/__cxx03/__thread/support/pthread.h b/libcxx/include/__cxx03/__thread/support/pthread.h
index 4dc7a4980de2b..4ec5531003e02 100644
--- a/libcxx/include/__cxx03/__thread/support/pthread.h
+++ b/libcxx/include/__cxx03/__thread/support/pthread.h
@@ -14,7 +14,7 @@
 #include <__cxx03/__chrono/duration.h>
 #include <__cxx03/__config>
 #include <__cxx03/ctime>
-#include <__cxx03/errno.h>
+#include <errno.h>
 #include <pthread.h>
 #include <sched.h>
 
diff --git a/libcxx/include/__cxx03/cctype b/libcxx/include/__cxx03/cctype
index 7f1becb46341b..e074f5410efa8 100644
--- a/libcxx/include/__cxx03/cctype
+++ b/libcxx/include/__cxx03/cctype
@@ -36,9 +36,9 @@ int toupper(int c);
 
 #include <__cxx03/__config>
 
-#include <__cxx03/ctype.h>
+#include <ctype.h>
 
-#ifndef _LIBCPP___CXX03_CTYPE_H
+#ifndef _LIBCPP_CTYPE_H
 #   error <cctype> tried including <ctype.h> but didn't find libc++'s <ctype.h> header. \
           This usually means that your header search paths are not configured properly.  \
           The header search paths should contain the C++ Standard Library headers before \
diff --git a/libcxx/include/__cxx03/cerrno b/libcxx/include/__cxx03/cerrno
index acb894ea19495..a11a53f5c2ac8 100644
--- a/libcxx/include/__cxx03/cerrno
+++ b/libcxx/include/__cxx03/cerrno
@@ -24,9 +24,9 @@ Macros:
 
 #include <__cxx03/__config>
 
-#include <__cxx03/errno.h>
+#include <errno.h>
 
-#ifndef _LIBCPP___CXX03_ERRNO_H
+#ifndef _LIBCPP_ERRNO_H
 #   error <cerrno> tried including <errno.h> but didn't find libc++'s <errno.h> header. \
           This usually means that your header search paths are not configured properly. \
           The header search paths should contain the C++ Standard Library headers before \
diff --git a/libcxx/include/__cxx03/cfenv b/libcxx/include/__cxx03/cfenv
index d707f5a65b9bc..d3a5839221a82 100644
--- a/libcxx/include/__cxx03/cfenv
+++ b/libcxx/include/__cxx03/cfenv
@@ -54,9 +54,9 @@ int feupdateenv(const fenv_t* envp);
 
 #include <__cxx03/__config>
 
-#include <__cxx03/fenv.h>
+#include <fenv.h>
 
-#ifndef _LIBCPP___CXX03_FENV_H
+#ifndef _LIBCPP_FENV_H
 #   error <cfenv> tried including <fenv.h> but didn't find libc++'s <fenv.h> header. \
           This usually means that your header search paths are not configured properly. \
           The header search paths should contain the C++ Standard Library headers before \
diff --git a/libcxx/include/__cxx03/cfloat b/libcxx/include/__cxx03/cfloat
index 5d10db6a454a6..a48a213f1669f 100644
--- a/libcxx/include/__cxx03/cfloat
+++ b/libcxx/include/__cxx03/cfloat
@@ -71,9 +71,9 @@ Macros:
 
 #include <__cxx03/__config>
 
-#include <__cxx03/float.h>
+#include <float.h>
 
-#ifndef _LIBCPP___CXX03_FLOAT_H
+#ifndef _LIBCPP_FLOAT_H
 #   error <cfloat> tried including <float.h> but didn't find libc++'s <float.h> header. \
           This usually means that your header search paths are not configured properly. \
           The header search paths should contain the C++ Standard Library headers before \
diff --git a/libcxx/include/__cxx03/cinttypes b/libcxx/include/__cxx03/cinttypes
index a14c1a57e66f9..68a926cc75646 100644
--- a/libcxx/include/__cxx03/cinttypes
+++ b/libcxx/include/__cxx03/cinttypes
@@ -241,9 +241,9 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
 // [cinttypes.syn]
 #include <__cxx03/cstdint>
 
-#include <__cxx03/inttypes.h>
+#include <inttypes.h>
 
-#ifndef _LIBCPP___CXX03_INTTYPES_H
+#ifndef _LIBCPP_INTTYPES_H
 #   error <cinttypes> tried including <inttypes.h> but didn't find libc++'s <inttypes.h> header. \
           This usually means that your header search paths are not configured properly. \
           The header search paths should contain the C++ Standard Library headers before \
diff --git a/libcxx/include/__cxx03/complex.h b/libcxx/include/__cxx03/complex.h
deleted file mode 100644
index 373017ff3f440..0000000000000
--- a/libcxx/include/__cxx03/complex.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_COMPLEX_H
-#define _LIBCPP___CXX03_COMPLEX_H
-
-/*
-    complex.h synopsis
-
-#include <__cxx03/ccomplex>
-
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-#ifdef __cplusplus
-#  include <__cxx03/ccomplex>
-#elif __has_include_next(<complex.h>)
-#  include_next <complex.h>
-#endif
-
-#endif // _LIBCPP___CXX03_COMPLEX_H
diff --git a/libcxx/include/__cxx03/cstddef b/libcxx/include/__cxx03/cstddef
index f1527901bd6b5..2b52c5fb42f95 100644
--- a/libcxx/include/__cxx03/cstddef
+++ b/libcxx/include/__cxx03/cstddef
@@ -39,9 +39,9 @@ Types:
 #include <__cxx03/__type_traits/is_integral.h>
 #include <__cxx03/version>
 
-#include <__cxx03/stddef.h>
+#include <stddef.h>
 
-#ifndef _LIBCPP___CXX03_STDDEF_H
+#ifndef _LIBCPP_STDDEF_H
 #   error <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header. \
           This usually means that your header search paths are not configured properly. \
           The header search paths should contain the C++ Standard Library headers before \
diff --git a/libcxx/include/__cxx03/cstdio b/libcxx/include/__cxx03/cstdio
index 166ac0d8abb61..90149044aeb8b 100644
--- a/libcxx/include/__cxx03/cstdio
+++ b/libcxx/include/__cxx03/cstdio
@@ -97,9 +97,9 @@ void perror(const char* s);
 
 #include <__cxx03/__config>
 
-#include <__cxx03/stdio.h>
+#include <stdio.h>
 
-#ifndef _LIBCPP___CXX03_STDIO_H
+#ifndef _LIBCPP_STDIO_H
 #   error <cstdio> tried including <stdio.h> but didn't find libc++'s <stdio.h> header. \
           This usually means that your header search paths are not configured properly. \
           The header search paths should contain the C++ Standard Library headers before \
diff --git a/libcxx/include/__cxx03/ctype.h b/libcxx/include/__cxx03/ctype.h
deleted file mode 100644
index cd4097ab012ff..0000000000000
--- a/libcxx/include/__cxx03/ctype.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_CTYPE_H
-#define _LIBCPP___CXX03_CTYPE_H
-
-/*
-    ctype.h synopsis
-
-int isalnum(int c);
-int isalpha(int c);
-int isblank(int c);  // C99
-int iscntrl(int c);
-int isdigit(int c);
-int isgraph(int c);
-int islower(int c);
-int isprint(int c);
-int ispunct(int c);
-int isspace(int c);
-int isupper(int c);
-int isxdigit(int c);
-int tolower(int c);
-int toupper(int c);
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-#if __has_include_next(<ctype.h>)
-#  include_next <ctype.h>
-#endif
-
-#ifdef __cplusplus
-
-#  undef isalnum
-#  undef isalpha
-#  undef isblank
-#  undef iscntrl
-#  undef isdigit
-#  undef isgraph
-#  undef islower
-#  undef isprint
-#  undef ispunct
-#  undef isspace
-#  undef isupper
-#  undef isxdigit
-#  undef tolower
-#  undef toupper
-
-#endif
-
-#endif // _LIBCPP___CXX03_CTYPE_H
diff --git a/libcxx/include/__cxx03/cwctype b/libcxx/include/__cxx03/cwctype
index 5228124936c6c..336b22634abf4 100644
--- a/libcxx/include/__cxx03/cwctype
+++ b/libcxx/include/__cxx03/cwctype
@@ -52,9 +52,9 @@ wctrans_t wctrans(const char* property);
 #include <__cxx03/__config>
 #include <__cxx03/cctype>
 
-#include <__cxx03/wctype.h>
+#include <wctype.h>
 
-#ifndef _LIBCPP___CXX03_WCTYPE_H
+#ifndef _LIBCPP_WCTYPE_H
 #   error <cwctype> tried including <wctype.h> but didn't find libc++'s <wctype.h> header. \
           This usually means that your header search paths are not configured properly. \
           The header search paths should contain the C++ Standard Library headers before \
diff --git a/libcxx/include/__cxx03/errno.h b/libcxx/include/__cxx03/errno.h
deleted file mode 100644
index 440235bef8545..0000000000000
--- a/libcxx/include/__cxx03/errno.h
+++ /dev/null
@@ -1,399 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_ERRNO_H
-#define _LIBCPP___CXX03_ERRNO_H
-
-/*
-    errno.h synopsis
-
-Macros:
-
-    EDOM
-    EILSEQ  // C99
-    ERANGE
-    errno
-
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-#if __has_include_next(<errno.h>)
-#  include_next <errno.h>
-#endif
-
-#ifdef __cplusplus
-
-#  if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
-
-#    ifdef ELAST
-
-static const int __elast1 = ELAST + 1;
-static const int __elast2 = ELAST + 2;
-
-#    else
-
-static const int __elast1 = 104;
-static const int __elast2 = 105;
-
-#    endif
-
-#    ifdef ENOTRECOVERABLE
-
-#      define EOWNERDEAD __elast1
-
-#      ifdef ELAST
-#        undef ELAST
-#        define ELAST EOWNERDEAD
-#      endif
-
-#    elif defined(EOWNERDEAD)
-
-#      define ENOTRECOVERABLE __elast1
-#      ifdef ELAST
-#        undef ELAST
-#        define ELAST ENOTRECOVERABLE
-#      endif
-
-#    else // defined(EOWNERDEAD)
-
-#      define EOWNERDEAD __elast1
-#      define ENOTRECOVERABLE __elast2
-#      ifdef ELAST
-#        undef ELAST
-#        define ELAST ENOTRECOVERABLE
-#      endif
-
-#    endif // defined(EOWNERDEAD)
-
-#  endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
-
-//  supply errno values likely to be missing, particularly on Windows
-
-#  ifndef EAFNOSUPPORT
-#    define EAFNOSUPPORT 9901
-#  endif
-
-#  ifndef EADDRINUSE
-#    define EADDRINUSE 9902
-#  endif
-
-#  ifndef EADDRNOTAVAIL
-#    define EADDRNOTAVAIL 9903
-#  endif
-
-#  ifndef EISCONN
-#    define EISCONN 9904
-#  endif
-
-#  ifndef EBADMSG
-#    define EBADMSG 9905
-#  endif
-
-#  ifndef ECONNABORTED
-#    define ECONNABORTED 9906
-#  endif
-
-#  ifndef EALREADY
-#    define EALREADY 9907
-#  endif
-
-#  ifndef ECONNREFUSED
-#    define ECONNREFUSED 9908
-#  endif
-
-#  ifndef ECONNRESET
-#    define ECONNRESET 9909
-#  endif
-
-#  ifndef EDESTADDRREQ
-#    define EDESTADDRREQ 9910
-#  endif
-
-#  ifndef EHOSTUNREACH
-#    define EHOSTUNREACH 9911
-#  endif
-
-#  ifndef EIDRM
-#    define EIDRM 9912
-#  endif
-
-#  ifndef EMSGSIZE
-#    define EMSGSIZE 9913
-#  endif
-
-#  ifndef ENETDOWN
-#    define ENETDOWN 9914
-#  endif
-
-#  ifndef ENETRESET
-#    define ENETRESET 9915
-#  endif
-
-#  ifndef ENETUNREACH
-#    define ENETUNREACH 9916
-#  endif
-
-#  ifndef ENOBUFS
-#    define ENOBUFS 9917
-#  endif
-
-#  ifndef ENOLINK
-#    define ENOLINK 9918
-#  endif
-
-#  ifndef ENODATA
-#    define ENODATA 9919
-#  endif
-
-#  ifndef ENOMSG
-#    define ENOMSG 9920
-#  endif
-
-#  ifndef ENOPROTOOPT
-#    define ENOPROTOOPT 9921
-#  endif
-
-#  ifndef ENOSR
-#    define ENOSR 9922
-#  endif
-
-#  ifndef ENOTSOCK
-#    define ENOTSOCK 9923
-#  endif
-
-#  ifndef ENOSTR
-#    define ENOSTR 9924
-#  endif
-
-#  ifndef ENOTCONN
-#    define ENOTCONN 9925
-#  endif
-
-#  ifndef ENOTSUP
-#    define ENOTSUP 9926
-#  endif
-
-#  ifndef ECANCELED
-#    define ECANCELED 9927
-#  endif
-
-#  ifndef EINPROGRESS
-#    define EINPROGRESS 9928
-#  endif
-
-#  ifndef EOPNOTSUPP
-#    define EOPNOTSUPP 9929
-#  endif
-
-#  ifndef EWOULDBLOCK
-#    define EWOULDBLOCK 9930
-#  endif
-
-#  ifndef EOWNERDEAD
-#    define EOWNERDEAD 9931
-#  endif
-
-#  ifndef EPROTO
-#    define EPROTO 9932
-#  endif
-
-#  ifndef EPROTONOSUPPORT
-#    define EPROTONOSUPPORT 9933
-#  endif
-
-#  ifndef ENOTRECOVERABLE
-#    define ENOTRECOVERABLE 9934
-#  endif
-
-#  ifndef ETIME
-#    define ETIME 9935
-#  endif
-
-#  ifndef ETXTBSY
-#    define ETXTBSY 9936
-#  endif
-
-#  ifndef ETIMEDOUT
-#    define ETIMEDOUT 9938
-#  endif
-
-#  ifndef ELOOP
-#    define ELOOP 9939
-#  endif
-
-#  ifndef EOVERFLOW
-#    define EOVERFLOW 9940
-#  endif
-
-#  ifndef EPROTOTYPE
-#    define EPROTOTYPE 9941
-#  endif
-
-#  ifndef ENOSYS
-#    define ENOSYS 9942
-#  endif
-
-#  ifndef EINVAL
-#    define EINVAL 9943
-#  endif
-
-#  ifndef ERANGE
-#    define ERANGE 9944
-#  endif
-
-#  ifndef EILSEQ
-#    define EILSEQ 9945
-#  endif
-
-//  Windows Mobile doesn't appear to define these:
-
-#  ifndef E2BIG
-#    define E2BIG 9946
-#  endif
-
-#  ifndef EDOM
-#    define EDOM 9947
-#  endif
-
-#  ifndef EFAULT
-#    define EFAULT 9948
-#  endif
-
-#  ifndef EBADF
-#    define EBADF 9949
-#  endif
-
-#  ifndef EPIPE
-#    define EPIPE 9950
-#  endif
-
-#  ifndef EXDEV
-#    define EXDEV 9951
-#  endif
-
-#  ifndef EBUSY
-#    define EBUSY 9952
-#  endif
-
-#  ifndef ENOTEMPTY
-#    define ENOTEMPTY 9953
-#  endif
-
-#  ifndef ENOEXEC
-#    define ENOEXEC 9954
-#  endif
-
-#  ifndef EEXIST
-#    define EEXIST 9955
-#  endif
-
-#  ifndef EFBIG
-#    define EFBIG 9956
-#  endif
-
-#  ifndef ENAMETOOLONG
-#    define ENAMETOOLONG 9957
-#  endif
-
-#  ifndef ENOTTY
-#    define ENOTTY 9958
-#  endif
-
-#  ifndef EINTR
-#    define EINTR 9959
-#  endif
-
-#  ifndef ESPIPE
-#    define ESPIPE 9960
-#  endif
-
-#  ifndef EIO
-#    define EIO 9961
-#  endif
-
-#  ifndef EISDIR
-#    define EISDIR 9962
-#  endif
-
-#  ifndef ECHILD
-#    define ECHILD 9963
-#  endif
-
-#  ifndef ENOLCK
-#    define ENOLCK 9964
-#  endif
-
-#  ifndef ENOSPC
-#    define ENOSPC 9965
-#  endif
-
-#  ifndef ENXIO
-#    define ENXIO 9966
-#  endif
-
-#  ifndef ENODEV
-#    define ENODEV 9967
-#  endif
-
-#  ifndef ENOENT
-#    define ENOENT 9968
-#  endif
-
-#  ifndef ESRCH
-#    define ESRCH 9969
-#  endif
-
-#  ifndef ENOTDIR
-#    define ENOTDIR 9970
-#  endif
-
-#  ifndef ENOMEM
-#    define ENOMEM 9971
-#  endif
-
-#  ifndef EPERM
-#    define EPERM 9972
-#  endif
-
-#  ifndef EACCES
-#    define EACCES 9973
-#  endif
-
-#  ifndef EROFS
-#    define EROFS 9974
-#  endif
-
-#  ifndef EDEADLK
-#    define EDEADLK 9975
-#  endif
-
-#  ifndef EAGAIN
-#    define EAGAIN 9976
-#  endif
-
-#  ifndef ENFILE
-#    define ENFILE 9977
-#  endif
-
-#  ifndef EMFILE
-#    define EMFILE 9978
-#  endif
-
-#  ifndef EMLINK
-#    define EMLINK 9979
-#  endif
-
-#endif // __cplusplus
-
-#endif // _LIBCPP___CXX03_ERRNO_H
diff --git a/libcxx/include/__cxx03/ext/__hash b/libcxx/include/__cxx03/ext/__hash
index 8f27c7ea105c5..e2c521568280a 100644
--- a/libcxx/include/__cxx03/ext/__hash
+++ b/libcxx/include/__cxx03/ext/__hash
@@ -14,8 +14,8 @@
 
 #include <__cxx03/__config>
 #include <__cxx03/cstring>
-#include <__cxx03/stddef.h>
 #include <__cxx03/string>
+#include <stddef.h>
 
 namespace __gnu_cxx {
 
diff --git a/libcxx/include/__cxx03/fenv.h b/libcxx/include/__cxx03/fenv.h
deleted file mode 100644
index 87fe9d18b2b77..0000000000000
--- a/libcxx/include/__cxx03/fenv.h
+++ /dev/null
@@ -1,114 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_FENV_H
-#define _LIBCPP___CXX03_FENV_H
-
-/*
-    fenv.h synopsis
-
-This entire header is C99 / C++0X
-
-Macros:
-
-    FE_DIVBYZERO
-    FE_INEXACT
-    FE_INVALID
-    FE_OVERFLOW
-    FE_UNDERFLOW
-    FE_ALL_EXCEPT
-    FE_DOWNWARD
-    FE_TONEAREST
-    FE_TOWARDZERO
-    FE_UPWARD
-    FE_DFL_ENV
-
-Types:
-
-    fenv_t
-    fexcept_t
-
-int feclearexcept(int excepts);
-int fegetexceptflag(fexcept_t* flagp, int excepts);
-int feraiseexcept(int excepts);
-int fesetexceptflag(const fexcept_t* flagp, int excepts);
-int fetestexcept(int excepts);
-int fegetround();
-int fesetround(int round);
-int fegetenv(fenv_t* envp);
-int feholdexcept(fenv_t* envp);
-int fesetenv(const fenv_t* envp);
-int feupdateenv(const fenv_t* envp);
-
-
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-#if __has_include_next(<fenv.h>)
-#  include_next <fenv.h>
-#endif
-
-#ifdef __cplusplus
-
-extern "C++" {
-
-#  ifdef feclearexcept
-#    undef feclearexcept
-#  endif
-
-#  ifdef fegetexceptflag
-#    undef fegetexceptflag
-#  endif
-
-#  ifdef feraiseexcept
-#    undef feraiseexcept
-#  endif
-
-#  ifdef fesetexceptflag
-#    undef fesetexceptflag
-#  endif
-
-#  ifdef fetestexcept
-#    undef fetestexcept
-#  endif
-
-#  ifdef fegetround
-#    undef fegetround
-#  endif
-
-#  ifdef fesetround
-#    undef fesetround
-#  endif
-
-#  ifdef fegetenv
-#    undef fegetenv
-#  endif
-
-#  ifdef feholdexcept
-#    undef feholdexcept
-#  endif
-
-#  ifdef fesetenv
-#    undef fesetenv
-#  endif
-
-#  ifdef feupdateenv
-#    undef feupdateenv
-#  endif
-
-} // extern "C++"
-
-#endif // defined(__cplusplus)
-
-#endif // _LIBCPP___CXX03_FENV_H
diff --git a/libcxx/include/__cxx03/float.h b/libcxx/include/__cxx03/float.h
deleted file mode 100644
index 38f199067f411..0000000000000
--- a/libcxx/include/__cxx03/float.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_FLOAT_H
-#define _LIBCPP___CXX03_FLOAT_H
-
-/*
-    float.h synopsis
-
-Macros:
-
-    FLT_ROUNDS
-    FLT_EVAL_METHOD     // C99
-    FLT_RADIX
-
-    FLT_MANT_DIG
-    DBL_MANT_DIG
-    LDBL_MANT_DIG
-
-    FLT_HAS_SUBNORM     // C11
-    DBL_HAS_SUBNORM     // C11
-    LDBL_HAS_SUBNORM    // C11
-
-    DECIMAL_DIG         // C99
-    FLT_DECIMAL_DIG     // C11
-    DBL_DECIMAL_DIG     // C11
-    LDBL_DECIMAL_DIG    // C11
-
-    FLT_DIG
-    DBL_DIG
-    LDBL_DIG
-
-    FLT_MIN_EXP
-    DBL_MIN_EXP
-    LDBL_MIN_EXP
-
-    FLT_MIN_10_EXP
-    DBL_MIN_10_EXP
-    LDBL_MIN_10_EXP
-
-    FLT_MAX_EXP
-    DBL_MAX_EXP
-    LDBL_MAX_EXP
-
-    FLT_MAX_10_EXP
-    DBL_MAX_10_EXP
-    LDBL_MAX_10_EXP
-
-    FLT_MAX
-    DBL_MAX
-    LDBL_MAX
-
-    FLT_EPSILON
-    DBL_EPSILON
-    LDBL_EPSILON
-
-    FLT_MIN
-    DBL_MIN
-    LDBL_MIN
-
-    FLT_TRUE_MIN        // C11
-    DBL_TRUE_MIN        // C11
-    LDBL_TRUE_MIN       // C11
-
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-#if __has_include_next(<float.h>)
-#  include_next <float.h>
-#endif
-
-#ifdef __cplusplus
-
-#  ifndef FLT_EVAL_METHOD
-#    define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
-#  endif
-
-#  ifndef DECIMAL_DIG
-#    define DECIMAL_DIG __DECIMAL_DIG__
-#  endif
-
-#endif // __cplusplus
-
-#endif // _LIBCPP___CXX03_FLOAT_H
diff --git a/libcxx/include/__cxx03/inttypes.h b/libcxx/include/__cxx03/inttypes.h
deleted file mode 100644
index 82acd87f5e8eb..0000000000000
--- a/libcxx/include/__cxx03/inttypes.h
+++ /dev/null
@@ -1,264 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_INTTYPES_H
-// AIX system headers need inttypes.h to be re-enterable while _STD_TYPES_T
-// is defined until an inclusion of it without _STD_TYPES_T occurs, in which
-// case the header guard macro is defined.
-#if !defined(_AIX) || !defined(_STD_TYPES_T)
-#  define _LIBCPP___CXX03_INTTYPES_H
-#endif // _STD_TYPES_T
-
-/*
-    inttypes.h synopsis
-
-This entire header is C99 / C++0X
-
-#include <__cxx03/stdint.h>  // <cinttypes> includes <cstdint>
-
-Macros:
-
-    PRId8
-    PRId16
-    PRId32
-    PRId64
-
-    PRIdLEAST8
-    PRIdLEAST16
-    PRIdLEAST32
-    PRIdLEAST64
-
-    PRIdFAST8
-    PRIdFAST16
-    PRIdFAST32
-    PRIdFAST64
-
-    PRIdMAX
-    PRIdPTR
-
-    PRIi8
-    PRIi16
-    PRIi32
-    PRIi64
-
-    PRIiLEAST8
-    PRIiLEAST16
-    PRIiLEAST32
-    PRIiLEAST64
-
-    PRIiFAST8
-    PRIiFAST16
-    PRIiFAST32
-    PRIiFAST64
-
-    PRIiMAX
-    PRIiPTR
-
-    PRIo8
-    PRIo16
-    PRIo32
-    PRIo64
-
-    PRIoLEAST8
-    PRIoLEAST16
-    PRIoLEAST32
-    PRIoLEAST64
-
-    PRIoFAST8
-    PRIoFAST16
-    PRIoFAST32
-    PRIoFAST64
-
-    PRIoMAX
-    PRIoPTR
-
-    PRIu8
-    PRIu16
-    PRIu32
-    PRIu64
-
-    PRIuLEAST8
-    PRIuLEAST16
-    PRIuLEAST32
-    PRIuLEAST64
-
-    PRIuFAST8
-    PRIuFAST16
-    PRIuFAST32
-    PRIuFAST64
-
-    PRIuMAX
-    PRIuPTR
-
-    PRIx8
-    PRIx16
-    PRIx32
-    PRIx64
-
-    PRIxLEAST8
-    PRIxLEAST16
-    PRIxLEAST32
-    PRIxLEAST64
-
-    PRIxFAST8
-    PRIxFAST16
-    PRIxFAST32
-    PRIxFAST64
-
-    PRIxMAX
-    PRIxPTR
-
-    PRIX8
-    PRIX16
-    PRIX32
-    PRIX64
-
-    PRIXLEAST8
-    PRIXLEAST16
-    PRIXLEAST32
-    PRIXLEAST64
-
-    PRIXFAST8
-    PRIXFAST16
-    PRIXFAST32
-    PRIXFAST64
-
-    PRIXMAX
-    PRIXPTR
-
-    SCNd8
-    SCNd16
-    SCNd32
-    SCNd64
-
-    SCNdLEAST8
-    SCNdLEAST16
-    SCNdLEAST32
-    SCNdLEAST64
-
-    SCNdFAST8
-    SCNdFAST16
-    SCNdFAST32
-    SCNdFAST64
-
-    SCNdMAX
-    SCNdPTR
-
-    SCNi8
-    SCNi16
-    SCNi32
-    SCNi64
-
-    SCNiLEAST8
-    SCNiLEAST16
-    SCNiLEAST32
-    SCNiLEAST64
-
-    SCNiFAST8
-    SCNiFAST16
-    SCNiFAST32
-    SCNiFAST64
-
-    SCNiMAX
-    SCNiPTR
-
-    SCNo8
-    SCNo16
-    SCNo32
-    SCNo64
-
-    SCNoLEAST8
-    SCNoLEAST16
-    SCNoLEAST32
-    SCNoLEAST64
-
-    SCNoFAST8
-    SCNoFAST16
-    SCNoFAST32
-    SCNoFAST64
-
-    SCNoMAX
-    SCNoPTR
-
-    SCNu8
-    SCNu16
-    SCNu32
-    SCNu64
-
-    SCNuLEAST8
-    SCNuLEAST16
-    SCNuLEAST32
-    SCNuLEAST64
-
-    SCNuFAST8
-    SCNuFAST16
-    SCNuFAST32
-    SCNuFAST64
-
-    SCNuMAX
-    SCNuPTR
-
-    SCNx8
-    SCNx16
-    SCNx32
-    SCNx64
-
-    SCNxLEAST8
-    SCNxLEAST16
-    SCNxLEAST32
-    SCNxLEAST64
-
-    SCNxFAST8
-    SCNxFAST16
-    SCNxFAST32
-    SCNxFAST64
-
-    SCNxMAX
-    SCNxPTR
-
-Types:
-
-    imaxdiv_t
-
-intmax_t  imaxabs(intmax_t j);
-imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
-intmax_t  strtoimax(const char* restrict nptr, char** restrict endptr, int base);
-uintmax_t strtoumax(const char* restrict nptr, char** restrict endptr, int base);
-intmax_t  wcstoimax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
-uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
-
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
-   for C++11 unless __STDC_FORMAT_MACROS is defined
-*/
-#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
-#  define __STDC_FORMAT_MACROS
-#endif
-
-#if __has_include_next(<inttypes.h>)
-#  include_next <inttypes.h>
-#endif
-
-#ifdef __cplusplus
-
-#  include <__cxx03/stdint.h>
-
-#  undef imaxabs
-#  undef imaxdiv
-
-#endif // __cplusplus
-
-#endif // _LIBCPP___CXX03_INTTYPES_H
diff --git a/libcxx/include/__cxx03/stdbool.h b/libcxx/include/__cxx03/stdbool.h
deleted file mode 100644
index e6c2eae2cfd12..0000000000000
--- a/libcxx/include/__cxx03/stdbool.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_STDBOOL_H
-#define _LIBCPP___CXX03_STDBOOL_H
-
-/*
-    stdbool.h synopsis
-
-Macros:
-
-    __bool_true_false_are_defined
-
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-#if __has_include_next(<stdbool.h>)
-#  include_next <stdbool.h>
-#endif
-
-#ifdef __cplusplus
-#  undef bool
-#  undef true
-#  undef false
-#  undef __bool_true_false_are_defined
-#  define __bool_true_false_are_defined 1
-#endif
-
-#endif // _LIBCPP___CXX03_STDBOOL_H
diff --git a/libcxx/include/__cxx03/stddef.h b/libcxx/include/__cxx03/stddef.h
deleted file mode 100644
index 5d46cf27c39f5..0000000000000
--- a/libcxx/include/__cxx03/stddef.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-/*
-    stddef.h synopsis
-
-Macros:
-
-    offsetof(type,member-designator)
-    NULL
-
-Types:
-
-    ptrdiff_t
-    size_t
-    max_align_t // C++11
-    nullptr_t
-
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-// Note: This include is outside of header guards because we sometimes get included multiple times
-//       with different defines and the underlying <stddef.h> will know how to deal with that.
-#include_next <stddef.h>
-
-#ifndef _LIBCPP___CXX03_STDDEF_H
-#  define _LIBCPP___CXX03_STDDEF_H
-
-#  ifdef __cplusplus
-typedef decltype(nullptr) nullptr_t;
-#  endif
-
-#endif // _LIBCPP___CXX03_STDDEF_H
diff --git a/libcxx/include/__cxx03/stdio.h b/libcxx/include/__cxx03/stdio.h
deleted file mode 100644
index 6c6671e90c9a8..0000000000000
--- a/libcxx/include/__cxx03/stdio.h
+++ /dev/null
@@ -1,123 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#if defined(__need_FILE) || defined(__need___FILE)
-
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
-
-#  include_next <stdio.h>
-
-#elif !defined(_LIBCPP___CXX03_STDIO_H)
-#  define _LIBCPP___CXX03_STDIO_H
-
-/*
-    stdio.h synopsis
-
-Macros:
-
-    BUFSIZ
-    EOF
-    FILENAME_MAX
-    FOPEN_MAX
-    L_tmpnam
-    NULL
-    SEEK_CUR
-    SEEK_END
-    SEEK_SET
-    TMP_MAX
-    _IOFBF
-    _IOLBF
-    _IONBF
-    stderr
-    stdin
-    stdout
-
-Types:
-
-FILE
-fpos_t
-size_t
-
-int remove(const char* filename);
-int rename(const char* old, const char* new);
-FILE* tmpfile(void);
-char* tmpnam(char* s);
-int fclose(FILE* stream);
-int fflush(FILE* stream);
-FILE* fopen(const char* restrict filename, const char* restrict mode);
-FILE* freopen(const char* restrict filename, const char * restrict mode,
-              FILE * restrict stream);
-void setbuf(FILE* restrict stream, char* restrict buf);
-int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
-int fprintf(FILE* restrict stream, const char* restrict format, ...);
-int fscanf(FILE* restrict stream, const char * restrict format, ...);
-int printf(const char* restrict format, ...);
-int scanf(const char* restrict format, ...);
-int snprintf(char* restrict s, size_t n, const char* restrict format, ...);    // C99
-int sprintf(char* restrict s, const char* restrict format, ...);
-int sscanf(const char* restrict s, const char* restrict format, ...);
-int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
-int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg);  // C99
-int vprintf(const char* restrict format, va_list arg);
-int vscanf(const char* restrict format, va_list arg);                          // C99
-int vsnprintf(char* restrict s, size_t n, const char* restrict format,         // C99
-              va_list arg);
-int vsprintf(char* restrict s, const char* restrict format, va_list arg);
-int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
-int fgetc(FILE* stream);
-char* fgets(char* restrict s, int n, FILE* restrict stream);
-int fputc(int c, FILE* stream);
-int fputs(const char* restrict s, FILE* restrict stream);
-int getc(FILE* stream);
-int getchar(void);
-char* gets(char* s);  // removed in C++14
-int putc(int c, FILE* stream);
-int putchar(int c);
-int puts(const char* s);
-int ungetc(int c, FILE* stream);
-size_t fread(void* restrict ptr, size_t size, size_t nmemb,
-             FILE* restrict stream);
-size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
-              FILE* restrict stream);
-int fgetpos(FILE* restrict stream, fpos_t* restrict pos);
-int fseek(FILE* stream, long offset, int whence);
-int fsetpos(FILE*stream, const fpos_t* pos);
-long ftell(FILE* stream);
-void rewind(FILE* stream);
-void clearerr(FILE* stream);
-int feof(FILE* stream);
-int ferror(FILE* stream);
-void perror(const char* s);
-*/
-
-#  include <__cxx03/__config>
-
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
-
-#  if __has_include_next(<stdio.h>)
-#    include_next <stdio.h>
-#  endif
-
-#  ifdef __cplusplus
-
-#    undef getc
-#    undef putc
-#    undef clearerr
-#    undef feof
-#    undef ferror
-#    undef putchar
-#    undef getchar
-
-#  endif
-
-#endif // _LIBCPP___CXX03_STDIO_H
diff --git a/libcxx/include/__cxx03/tgmath.h b/libcxx/include/__cxx03/tgmath.h
deleted file mode 100644
index 7d81a110ed610..0000000000000
--- a/libcxx/include/__cxx03/tgmath.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_TGMATH_H
-#define _LIBCPP___CXX03_TGMATH_H
-
-/*
-    tgmath.h synopsis
-
-#include <__cxx03/ctgmath>
-
-*/
-
-#include <__cxx03/__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-#ifdef __cplusplus
-#  include <__cxx03/ctgmath>
-#else
-#  if __has_include_next(<tgmath.h>)
-#    include_next <tgmath.h>
-#  endif
-#endif
-
-#endif // _LIBCPP___CXX03_TGMATH_H
diff --git a/libcxx/include/__cxx03/wchar.h b/libcxx/include/__cxx03/wchar.h
index 91975f7df49bd..f30b18df9c9f7 100644
--- a/libcxx/include/__cxx03/wchar.h
+++ b/libcxx/include/__cxx03/wchar.h
@@ -106,7 +106,7 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
 */
 
 #  include <__cxx03/__config>
-#  include <__cxx03/stddef.h>
+#  include <stddef.h>
 
 #  if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
 #    error                                                                                                             \
diff --git a/libcxx/include/__cxx03/wctype.h b/libcxx/include/__cxx03/wctype.h
deleted file mode 100644
index 131d8b51ea1ca..0000000000000
--- a/libcxx/include/__cxx03/wctype.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03_WCTYPE_H
-#define _LIBCPP___CXX03_WCTYPE_H
-
-/*
-    wctype.h synopsis
-
-Macros:
-
-    WEOF
-
-Types:
-
-    wint_t
-    wctrans_t
-    wctype_t
-
-int iswalnum(wint_t wc);
-int iswalpha(wint_t wc);
-int iswblank(wint_t wc);  // C99
-int iswcntrl(wint_t wc);
-int iswdigit(wint_t wc);
-int iswgraph(wint_t wc);
-int iswlower(wint_t wc);
-int iswprint(wint_t wc);
-int iswpunct(wint_t wc);
-int iswspace(wint_t wc);
-int iswupper(wint_t wc);
-int iswxdigit(wint_t wc);
-int iswctype(wint_t wc, wctype_t desc);
-wctype_t wctype(const char* property);
-wint_t towlower(wint_t wc);
-wint_t towupper(wint_t wc);
-wint_t towctrans(wint_t wc, wctrans_t desc);
-wctrans_t wctrans(const char* property);
-
-*/
-
-#include <__cxx03/__config>
-
-#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
-#  error                                                                                                               \
-      "The <wctype.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
-#endif
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-// TODO:
-// In the future, we should unconditionally include_next <wctype.h> here and instead
-// have a mode under which the library does not need libc++'s <wctype.h> or <cwctype>
-// at all (i.e. a mode without wchar_t). As it stands, we need to do that to completely
-// bypass the using declarations in <cwctype> when we did not include <__cxx03/wctype.h>.
-// Otherwise, a using declaration like `using ::wint_t` in <cwctype> will refer to
-// nothing (with using_if_exists), and if we include another header that defines one
-// of these declarations (e.g. <wchar.h>), the second `using ::wint_t` with using_if_exists
-// will fail because it does not refer to the same declaration.
-#if __has_include_next(<wctype.h>)
-#  include_next <wctype.h>
-#  define _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
-#endif
-
-#ifdef __cplusplus
-
-#  undef iswalnum
-#  undef iswalpha
-#  undef iswblank
-#  undef iswcntrl
-#  undef iswdigit
-#  undef iswgraph
-#  undef iswlower
-#  undef iswprint
-#  undef iswpunct
-#  undef iswspace
-#  undef iswupper
-#  undef iswxdigit
-#  undef iswctype
-#  undef wctype
-#  undef towlower
-#  undef towupper
-#  undef towctrans
-#  undef wctrans
-
-#endif // __cplusplus
-
-#endif // _LIBCPP___CXX03_WCTYPE_H
diff --git a/libcxx/include/complex.h b/libcxx/include/complex.h
index 8a1f92689601f..09d8080f0f374 100644
--- a/libcxx/include/complex.h
+++ b/libcxx/include/complex.h
@@ -18,19 +18,19 @@
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/complex.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
-#  ifdef __cplusplus
-#    include <complex>
-#  elif __has_include_next(<complex.h>)
-#    include_next <complex.h>
-#  endif
-#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#ifdef __cplusplus
+#  include <complex>
+#elif __has_include_next(<complex.h>)
+#  include_next <complex.h>
+#endif
 
 #endif // _LIBCPP_COMPLEX_H
diff --git a/libcxx/include/ctype.h b/libcxx/include/ctype.h
index 066f45018bbf5..b2f83ca1c1aa4 100644
--- a/libcxx/include/ctype.h
+++ b/libcxx/include/ctype.h
@@ -30,36 +30,36 @@ int toupper(int c);
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/ctype.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
-#  if __has_include_next(<ctype.h>)
-#    include_next <ctype.h>
-#  endif
+#if __has_include_next(<ctype.h>)
+#  include_next <ctype.h>
+#endif
 
-#  ifdef __cplusplus
+#ifdef __cplusplus
 
-#    undef isalnum
-#    undef isalpha
-#    undef isblank
-#    undef iscntrl
-#    undef isdigit
-#    undef isgraph
-#    undef islower
-#    undef isprint
-#    undef ispunct
-#    undef isspace
-#    undef isupper
-#    undef isxdigit
-#    undef tolower
-#    undef toupper
+#  undef isalnum
+#  undef isalpha
+#  undef isblank
+#  undef iscntrl
+#  undef isdigit
+#  undef isgraph
+#  undef islower
+#  undef isprint
+#  undef ispunct
+#  undef isspace
+#  undef isupper
+#  undef isxdigit
+#  undef tolower
+#  undef toupper
 
-#  endif
-#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#endif
 
 #endif // _LIBCPP_CTYPE_H
diff --git a/libcxx/include/errno.h b/libcxx/include/errno.h
index 692f00f022c53..e87ad0d1b73e9 100644
--- a/libcxx/include/errno.h
+++ b/libcxx/include/errno.h
@@ -23,381 +23,381 @@
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/errno.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
-#  if __has_include_next(<errno.h>)
-#    include_next <errno.h>
-#  endif
+#if __has_include_next(<errno.h>)
+#  include_next <errno.h>
+#endif
 
-#  ifdef __cplusplus
+#ifdef __cplusplus
 
-#    if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
+#  if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
 
-#      ifdef ELAST
+#    ifdef ELAST
 
 static const int __elast1 = ELAST + 1;
 static const int __elast2 = ELAST + 2;
 
-#      else
+#    else
 
 static const int __elast1 = 104;
 static const int __elast2 = 105;
 
-#      endif
+#    endif
 
-#      ifdef ENOTRECOVERABLE
+#    ifdef ENOTRECOVERABLE
 
-#        define EOWNERDEAD __elast1
+#      define EOWNERDEAD __elast1
 
-#        ifdef ELAST
-#          undef ELAST
-#          define ELAST EOWNERDEAD
-#        endif
+#      ifdef ELAST
+#        undef ELAST
+#        define ELAST EOWNERDEAD
+#      endif
 
-#      elif defined(EOWNERDEAD)
+#    elif defined(EOWNERDEAD)
 
-#        define ENOTRECOVERABLE __elast1
-#        ifdef ELAST
-#          undef ELAST
-#          define ELAST ENOTRECOVERABLE
-#        endif
+#      define ENOTRECOVERABLE __elast1
+#      ifdef ELAST
+#        undef ELAST
+#        define ELAST ENOTRECOVERABLE
+#      endif
 
-#      else // defined(EOWNERDEAD)
+#    else // defined(EOWNERDEAD)
 
-#        define EOWNERDEAD __elast1
-#        define ENOTRECOVERABLE __elast2
-#        ifdef ELAST
-#          undef ELAST
-#          define ELAST ENOTRECOVERABLE
-#        endif
+#      define EOWNERDEAD __elast1
+#      define ENOTRECOVERABLE __elast2
+#      ifdef ELAST
+#        undef ELAST
+#        define ELAST ENOTRECOVERABLE
+#      endif
 
-#      endif // defined(EOWNERDEAD)
+#    endif // defined(EOWNERDEAD)
 
-#    endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
+#  endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
 
 //  supply errno values likely to be missing, particularly on Windows
 
-#    ifndef EAFNOSUPPORT
-#      define EAFNOSUPPORT 9901
-#    endif
+#  ifndef EAFNOSUPPORT
+#    define EAFNOSUPPORT 9901
+#  endif
 
-#    ifndef EADDRINUSE
-#      define EADDRINUSE 9902
-#    endif
+#  ifndef EADDRINUSE
+#    define EADDRINUSE 9902
+#  endif
 
-#    ifndef EADDRNOTAVAIL
-#      define EADDRNOTAVAIL 9903
-#    endif
+#  ifndef EADDRNOTAVAIL
+#    define EADDRNOTAVAIL 9903
+#  endif
 
-#    ifndef EISCONN
-#      define EISCONN 9904
-#    endif
+#  ifndef EISCONN
+#    define EISCONN 9904
+#  endif
 
-#    ifndef EBADMSG
-#      define EBADMSG 9905
-#    endif
+#  ifndef EBADMSG
+#    define EBADMSG 9905
+#  endif
 
-#    ifndef ECONNABORTED
-#      define ECONNABORTED 9906
-#    endif
+#  ifndef ECONNABORTED
+#    define ECONNABORTED 9906
+#  endif
 
-#    ifndef EALREADY
-#      define EALREADY 9907
-#    endif
+#  ifndef EALREADY
+#    define EALREADY 9907
+#  endif
 
-#    ifndef ECONNREFUSED
-#      define ECONNREFUSED 9908
-#    endif
+#  ifndef ECONNREFUSED
+#    define ECONNREFUSED 9908
+#  endif
 
-#    ifndef ECONNRESET
-#      define ECONNRESET 9909
-#    endif
+#  ifndef ECONNRESET
+#    define ECONNRESET 9909
+#  endif
 
-#    ifndef EDESTADDRREQ
-#      define EDESTADDRREQ 9910
-#    endif
+#  ifndef EDESTADDRREQ
+#    define EDESTADDRREQ 9910
+#  endif
 
-#    ifndef EHOSTUNREACH
-#      define EHOSTUNREACH 9911
-#    endif
+#  ifndef EHOSTUNREACH
+#    define EHOSTUNREACH 9911
+#  endif
 
-#    ifndef EIDRM
-#      define EIDRM 9912
-#    endif
+#  ifndef EIDRM
+#    define EIDRM 9912
+#  endif
 
-#    ifndef EMSGSIZE
-#      define EMSGSIZE 9913
-#    endif
+#  ifndef EMSGSIZE
+#    define EMSGSIZE 9913
+#  endif
 
-#    ifndef ENETDOWN
-#      define ENETDOWN 9914
-#    endif
+#  ifndef ENETDOWN
+#    define ENETDOWN 9914
+#  endif
 
-#    ifndef ENETRESET
-#      define ENETRESET 9915
-#    endif
+#  ifndef ENETRESET
+#    define ENETRESET 9915
+#  endif
 
-#    ifndef ENETUNREACH
-#      define ENETUNREACH 9916
-#    endif
+#  ifndef ENETUNREACH
+#    define ENETUNREACH 9916
+#  endif
 
-#    ifndef ENOBUFS
-#      define ENOBUFS 9917
-#    endif
+#  ifndef ENOBUFS
+#    define ENOBUFS 9917
+#  endif
 
-#    ifndef ENOLINK
-#      define ENOLINK 9918
-#    endif
+#  ifndef ENOLINK
+#    define ENOLINK 9918
+#  endif
 
-#    ifndef ENODATA
-#      define ENODATA 9919
-#    endif
+#  ifndef ENODATA
+#    define ENODATA 9919
+#  endif
 
-#    ifndef ENOMSG
-#      define ENOMSG 9920
-#    endif
+#  ifndef ENOMSG
+#    define ENOMSG 9920
+#  endif
 
-#    ifndef ENOPROTOOPT
-#      define ENOPROTOOPT 9921
-#    endif
+#  ifndef ENOPROTOOPT
+#    define ENOPROTOOPT 9921
+#  endif
 
-#    ifndef ENOSR
-#      define ENOSR 9922
-#    endif
+#  ifndef ENOSR
+#    define ENOSR 9922
+#  endif
 
-#    ifndef ENOTSOCK
-#      define ENOTSOCK 9923
-#    endif
+#  ifndef ENOTSOCK
+#    define ENOTSOCK 9923
+#  endif
 
-#    ifndef ENOSTR
-#      define ENOSTR 9924
-#    endif
+#  ifndef ENOSTR
+#    define ENOSTR 9924
+#  endif
 
-#    ifndef ENOTCONN
-#      define ENOTCONN 9925
-#    endif
+#  ifndef ENOTCONN
+#    define ENOTCONN 9925
+#  endif
 
-#    ifndef ENOTSUP
-#      define ENOTSUP 9926
-#    endif
+#  ifndef ENOTSUP
+#    define ENOTSUP 9926
+#  endif
 
-#    ifndef ECANCELED
-#      define ECANCELED 9927
-#    endif
+#  ifndef ECANCELED
+#    define ECANCELED 9927
+#  endif
 
-#    ifndef EINPROGRESS
-#      define EINPROGRESS 9928
-#    endif
+#  ifndef EINPROGRESS
+#    define EINPROGRESS 9928
+#  endif
 
-#    ifndef EOPNOTSUPP
-#      define EOPNOTSUPP 9929
-#    endif
+#  ifndef EOPNOTSUPP
+#    define EOPNOTSUPP 9929
+#  endif
 
-#    ifndef EWOULDBLOCK
-#      define EWOULDBLOCK 9930
-#    endif
+#  ifndef EWOULDBLOCK
+#    define EWOULDBLOCK 9930
+#  endif
 
-#    ifndef EOWNERDEAD
-#      define EOWNERDEAD 9931
-#    endif
+#  ifndef EOWNERDEAD
+#    define EOWNERDEAD 9931
+#  endif
 
-#    ifndef EPROTO
-#      define EPROTO 9932
-#    endif
+#  ifndef EPROTO
+#    define EPROTO 9932
+#  endif
 
-#    ifndef EPROTONOSUPPORT
-#      define EPROTONOSUPPORT 9933
-#    endif
+#  ifndef EPROTONOSUPPORT
+#    define EPROTONOSUPPORT 9933
+#  endif
 
-#    ifndef ENOTRECOVERABLE
-#      define ENOTRECOVERABLE 9934
-#    endif
+#  ifndef ENOTRECOVERABLE
+#    define ENOTRECOVERABLE 9934
+#  endif
 
-#    ifndef ETIME
-#      define ETIME 9935
-#    endif
+#  ifndef ETIME
+#    define ETIME 9935
+#  endif
 
-#    ifndef ETXTBSY
-#      define ETXTBSY 9936
-#    endif
+#  ifndef ETXTBSY
+#    define ETXTBSY 9936
+#  endif
 
-#    ifndef ETIMEDOUT
-#      define ETIMEDOUT 9938
-#    endif
+#  ifndef ETIMEDOUT
+#    define ETIMEDOUT 9938
+#  endif
 
-#    ifndef ELOOP
-#      define ELOOP 9939
-#    endif
+#  ifndef ELOOP
+#    define ELOOP 9939
+#  endif
 
-#    ifndef EOVERFLOW
-#      define EOVERFLOW 9940
-#    endif
+#  ifndef EOVERFLOW
+#    define EOVERFLOW 9940
+#  endif
 
-#    ifndef EPROTOTYPE
-#      define EPROTOTYPE 9941
-#    endif
+#  ifndef EPROTOTYPE
+#    define EPROTOTYPE 9941
+#  endif
 
-#    ifndef ENOSYS
-#      define ENOSYS 9942
-#    endif
+#  ifndef ENOSYS
+#    define ENOSYS 9942
+#  endif
 
-#    ifndef EINVAL
-#      define EINVAL 9943
-#    endif
+#  ifndef EINVAL
+#    define EINVAL 9943
+#  endif
 
-#    ifndef ERANGE
-#      define ERANGE 9944
-#    endif
+#  ifndef ERANGE
+#    define ERANGE 9944
+#  endif
 
-#    ifndef EILSEQ
-#      define EILSEQ 9945
-#    endif
+#  ifndef EILSEQ
+#    define EILSEQ 9945
+#  endif
 
 //  Windows Mobile doesn't appear to define these:
 
-#    ifndef E2BIG
-#      define E2BIG 9946
-#    endif
+#  ifndef E2BIG
+#    define E2BIG 9946
+#  endif
 
-#    ifndef EDOM
-#      define EDOM 9947
-#    endif
+#  ifndef EDOM
+#    define EDOM 9947
+#  endif
 
-#    ifndef EFAULT
-#      define EFAULT 9948
-#    endif
+#  ifndef EFAULT
+#    define EFAULT 9948
+#  endif
 
-#    ifndef EBADF
-#      define EBADF 9949
-#    endif
+#  ifndef EBADF
+#    define EBADF 9949
+#  endif
 
-#    ifndef EPIPE
-#      define EPIPE 9950
-#    endif
+#  ifndef EPIPE
+#    define EPIPE 9950
+#  endif
 
-#    ifndef EXDEV
-#      define EXDEV 9951
-#    endif
+#  ifndef EXDEV
+#    define EXDEV 9951
+#  endif
 
-#    ifndef EBUSY
-#      define EBUSY 9952
-#    endif
+#  ifndef EBUSY
+#    define EBUSY 9952
+#  endif
 
-#    ifndef ENOTEMPTY
-#      define ENOTEMPTY 9953
-#    endif
+#  ifndef ENOTEMPTY
+#    define ENOTEMPTY 9953
+#  endif
 
-#    ifndef ENOEXEC
-#      define ENOEXEC 9954
-#    endif
+#  ifndef ENOEXEC
+#    define ENOEXEC 9954
+#  endif
 
-#    ifndef EEXIST
-#      define EEXIST 9955
-#    endif
+#  ifndef EEXIST
+#    define EEXIST 9955
+#  endif
 
-#    ifndef EFBIG
-#      define EFBIG 9956
-#    endif
+#  ifndef EFBIG
+#    define EFBIG 9956
+#  endif
 
-#    ifndef ENAMETOOLONG
-#      define ENAMETOOLONG 9957
-#    endif
+#  ifndef ENAMETOOLONG
+#    define ENAMETOOLONG 9957
+#  endif
 
-#    ifndef ENOTTY
-#      define ENOTTY 9958
-#    endif
+#  ifndef ENOTTY
+#    define ENOTTY 9958
+#  endif
 
-#    ifndef EINTR
-#      define EINTR 9959
-#    endif
+#  ifndef EINTR
+#    define EINTR 9959
+#  endif
 
-#    ifndef ESPIPE
-#      define ESPIPE 9960
-#    endif
+#  ifndef ESPIPE
+#    define ESPIPE 9960
+#  endif
 
-#    ifndef EIO
-#      define EIO 9961
-#    endif
+#  ifndef EIO
+#    define EIO 9961
+#  endif
 
-#    ifndef EISDIR
-#      define EISDIR 9962
-#    endif
+#  ifndef EISDIR
+#    define EISDIR 9962
+#  endif
 
-#    ifndef ECHILD
-#      define ECHILD 9963
-#    endif
+#  ifndef ECHILD
+#    define ECHILD 9963
+#  endif
 
-#    ifndef ENOLCK
-#      define ENOLCK 9964
-#    endif
+#  ifndef ENOLCK
+#    define ENOLCK 9964
+#  endif
 
-#    ifndef ENOSPC
-#      define ENOSPC 9965
-#    endif
+#  ifndef ENOSPC
+#    define ENOSPC 9965
+#  endif
 
-#    ifndef ENXIO
-#      define ENXIO 9966
-#    endif
+#  ifndef ENXIO
+#    define ENXIO 9966
+#  endif
 
-#    ifndef ENODEV
-#      define ENODEV 9967
-#    endif
+#  ifndef ENODEV
+#    define ENODEV 9967
+#  endif
 
-#    ifndef ENOENT
-#      define ENOENT 9968
-#    endif
+#  ifndef ENOENT
+#    define ENOENT 9968
+#  endif
 
-#    ifndef ESRCH
-#      define ESRCH 9969
-#    endif
+#  ifndef ESRCH
+#    define ESRCH 9969
+#  endif
 
-#    ifndef ENOTDIR
-#      define ENOTDIR 9970
-#    endif
+#  ifndef ENOTDIR
+#    define ENOTDIR 9970
+#  endif
 
-#    ifndef ENOMEM
-#      define ENOMEM 9971
-#    endif
+#  ifndef ENOMEM
+#    define ENOMEM 9971
+#  endif
 
-#    ifndef EPERM
-#      define EPERM 9972
-#    endif
+#  ifndef EPERM
+#    define EPERM 9972
+#  endif
 
-#    ifndef EACCES
-#      define EACCES 9973
-#    endif
+#  ifndef EACCES
+#    define EACCES 9973
+#  endif
 
-#    ifndef EROFS
-#      define EROFS 9974
-#    endif
+#  ifndef EROFS
+#    define EROFS 9974
+#  endif
 
-#    ifndef EDEADLK
-#      define EDEADLK 9975
-#    endif
+#  ifndef EDEADLK
+#    define EDEADLK 9975
+#  endif
 
-#    ifndef EAGAIN
-#      define EAGAIN 9976
-#    endif
+#  ifndef EAGAIN
+#    define EAGAIN 9976
+#  endif
 
-#    ifndef ENFILE
-#      define ENFILE 9977
-#    endif
+#  ifndef ENFILE
+#    define ENFILE 9977
+#  endif
 
-#    ifndef EMFILE
-#      define EMFILE 9978
-#    endif
+#  ifndef EMFILE
+#    define EMFILE 9978
+#  endif
 
-#    ifndef EMLINK
-#      define EMLINK 9979
-#    endif
+#  ifndef EMLINK
+#    define EMLINK 9979
+#  endif
 
-#  endif // __cplusplus
-#endif   // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#endif // __cplusplus
 
 #endif // _LIBCPP_ERRNO_H
diff --git a/libcxx/include/fenv.h b/libcxx/include/fenv.h
index 157c24faa1042..a767269b5c989 100644
--- a/libcxx/include/fenv.h
+++ b/libcxx/include/fenv.h
@@ -50,69 +50,69 @@ int feupdateenv(const fenv_t* envp);
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/fenv.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
-#  if __has_include_next(<fenv.h>)
-#    include_next <fenv.h>
-#  endif
+#if __has_include_next(<fenv.h>)
+#  include_next <fenv.h>
+#endif
 
-#  ifdef __cplusplus
+#ifdef __cplusplus
 
 extern "C++" {
 
-#    ifdef feclearexcept
-#      undef feclearexcept
-#    endif
+#  ifdef feclearexcept
+#    undef feclearexcept
+#  endif
 
-#    ifdef fegetexceptflag
-#      undef fegetexceptflag
-#    endif
+#  ifdef fegetexceptflag
+#    undef fegetexceptflag
+#  endif
 
-#    ifdef feraiseexcept
-#      undef feraiseexcept
-#    endif
+#  ifdef feraiseexcept
+#    undef feraiseexcept
+#  endif
 
-#    ifdef fesetexceptflag
-#      undef fesetexceptflag
-#    endif
+#  ifdef fesetexceptflag
+#    undef fesetexceptflag
+#  endif
 
-#    ifdef fetestexcept
-#      undef fetestexcept
-#    endif
+#  ifdef fetestexcept
+#    undef fetestexcept
+#  endif
 
-#    ifdef fegetround
-#      undef fegetround
-#    endif
+#  ifdef fegetround
+#    undef fegetround
+#  endif
 
-#    ifdef fesetround
-#      undef fesetround
-#    endif
+#  ifdef fesetround
+#    undef fesetround
+#  endif
 
-#    ifdef fegetenv
-#      undef fegetenv
-#    endif
+#  ifdef fegetenv
+#    undef fegetenv
+#  endif
 
-#    ifdef feholdexcept
-#      undef feholdexcept
-#    endif
+#  ifdef feholdexcept
+#    undef feholdexcept
+#  endif
 
-#    ifdef fesetenv
-#      undef fesetenv
-#    endif
+#  ifdef fesetenv
+#    undef fesetenv
+#  endif
 
-#    ifdef feupdateenv
-#      undef feupdateenv
-#    endif
+#  ifdef feupdateenv
+#    undef feupdateenv
+#  endif
 
 } // extern "C++"
 
-#  endif // defined(__cplusplus)
-#endif   // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#endif // defined(__cplusplus)
 
 #endif // _LIBCPP_FENV_H
diff --git a/libcxx/include/float.h b/libcxx/include/float.h
index a6e79db912487..9de29ec7392f3 100644
--- a/libcxx/include/float.h
+++ b/libcxx/include/float.h
@@ -71,29 +71,29 @@
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/float.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
-#  if __has_include_next(<float.h>)
-#    include_next <float.h>
-#  endif
+#if __has_include_next(<float.h>)
+#  include_next <float.h>
+#endif
 
-#  ifdef __cplusplus
+#ifdef __cplusplus
 
-#    ifndef FLT_EVAL_METHOD
-#      define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
-#    endif
+#  ifndef FLT_EVAL_METHOD
+#    define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#  endif
 
-#    ifndef DECIMAL_DIG
-#      define DECIMAL_DIG __DECIMAL_DIG__
-#    endif
+#  ifndef DECIMAL_DIG
+#    define DECIMAL_DIG __DECIMAL_DIG__
+#  endif
 
-#  endif // __cplusplus
-#endif   // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#endif // __cplusplus
 
 #endif // _LIBCPP_FLOAT_H
diff --git a/libcxx/include/inttypes.h b/libcxx/include/inttypes.h
index 1869284550e90..cd487a8408275 100644
--- a/libcxx/include/inttypes.h
+++ b/libcxx/include/inttypes.h
@@ -236,33 +236,33 @@ uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/inttypes.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
 /* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
    for C++11 unless __STDC_FORMAT_MACROS is defined
 */
-#  if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
-#    define __STDC_FORMAT_MACROS
-#  endif
+#if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
+#  define __STDC_FORMAT_MACROS
+#endif
 
-#  if __has_include_next(<inttypes.h>)
-#    include_next <inttypes.h>
-#  endif
+#if __has_include_next(<inttypes.h>)
+#  include_next <inttypes.h>
+#endif
 
-#  ifdef __cplusplus
+#ifdef __cplusplus
 
-#    include <stdint.h>
+#  include <stdint.h>
 
-#    undef imaxabs
-#    undef imaxdiv
+#  undef imaxabs
+#  undef imaxdiv
 
-#  endif // __cplusplus
-#endif   // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#endif // __cplusplus
 
 #endif // _LIBCPP_INTTYPES_H
diff --git a/libcxx/include/stdbool.h b/libcxx/include/stdbool.h
index c34853b97b854..768d08247256a 100644
--- a/libcxx/include/stdbool.h
+++ b/libcxx/include/stdbool.h
@@ -20,25 +20,25 @@
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/stdbool.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
-
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
-
-#  if __has_include_next(<stdbool.h>)
-#    include_next <stdbool.h>
-#  endif
-
-#  ifdef __cplusplus
-#    undef bool
-#    undef true
-#    undef false
-#    undef __bool_true_false_are_defined
-#    define __bool_true_false_are_defined 1
-#  endif
-#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+#if __has_include_next(<stdbool.h>)
+#  include_next <stdbool.h>
+#endif
+
+#ifdef __cplusplus
+#  undef bool
+#  undef true
+#  undef false
+#  undef __bool_true_false_are_defined
+#  define __bool_true_false_are_defined 1
+#endif
 
 #endif // _LIBCPP_STDBOOL_H
diff --git a/libcxx/include/stddef.h b/libcxx/include/stddef.h
index 46bed2a1e1a68..e9e259da152d2 100644
--- a/libcxx/include/stddef.h
+++ b/libcxx/include/stddef.h
@@ -25,24 +25,24 @@
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/stddef.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
 // Note: This include is outside of header guards because we sometimes get included multiple times
 //       with different defines and the underlying <stddef.h> will know how to deal with that.
-#  include_next <stddef.h>
+#include_next <stddef.h>
 
-#  ifndef _LIBCPP_STDDEF_H
-#    define _LIBCPP_STDDEF_H
+#ifndef _LIBCPP_STDDEF_H
+#  define _LIBCPP_STDDEF_H
 
-#    ifdef __cplusplus
+#  ifdef __cplusplus
 typedef decltype(nullptr) nullptr_t;
-#    endif
-#  endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#  endif
 
 #endif // _LIBCPP_STDDEF_H
diff --git a/libcxx/include/stdio.h b/libcxx/include/stdio.h
index 20b845a00b477..4ce98d178ed2f 100644
--- a/libcxx/include/stdio.h
+++ b/libcxx/include/stdio.h
@@ -88,35 +88,34 @@ void perror(const char* s);
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/stdio.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
 // The inclusion of the system's <stdio.h> is intentionally done once outside of any include
 // guards because some code expects to be able to include the underlying system header multiple
 // times to get different definitions based on the macros that are set before inclusion.
-#  if __has_include_next(<stdio.h>)
-#    include_next <stdio.h>
-#  endif
+#if __has_include_next(<stdio.h>)
+#  include_next <stdio.h>
+#endif
 
-#  ifndef _LIBCPP_STDIO_H
-#    define _LIBCPP_STDIO_H
+#ifndef _LIBCPP_STDIO_H
+#  define _LIBCPP_STDIO_H
 
-#    ifdef __cplusplus
+#  ifdef __cplusplus
 
-#      undef getc
-#      undef putc
-#      undef clearerr
-#      undef feof
-#      undef ferror
-#      undef putchar
-#      undef getchar
+#    undef getc
+#    undef putc
+#    undef clearerr
+#    undef feof
+#    undef ferror
+#    undef putchar
+#    undef getchar
 
-#    endif // __cplusplus
-#  endif   // _LIBCPP_STDIO_H
-
-#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#  endif // __cplusplus
+#endif   // _LIBCPP_STDIO_H
diff --git a/libcxx/include/tgmath.h b/libcxx/include/tgmath.h
index 3f8f14fd579a9..6ed7a2bd68020 100644
--- a/libcxx/include/tgmath.h
+++ b/libcxx/include/tgmath.h
@@ -18,22 +18,22 @@
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/tgmath.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
-#  ifdef __cplusplus
-#    include <cmath>
-#    include <complex>
-#  else
-#    if __has_include_next(<tgmath.h>)
-#      include_next <tgmath.h>
-#    endif
+#ifdef __cplusplus
+#  include <cmath>
+#  include <complex>
+#else
+#  if __has_include_next(<tgmath.h>)
+#    include_next <tgmath.h>
 #  endif
-#endif // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#endif
 
 #endif // _LIBCPP_TGMATH_H
diff --git a/libcxx/include/wctype.h b/libcxx/include/wctype.h
index 9a5b163ba43a9..d2607406d8c4c 100644
--- a/libcxx/include/wctype.h
+++ b/libcxx/include/wctype.h
@@ -45,13 +45,14 @@ wctrans_t wctrans(const char* property);
 */
 
 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/wctype.h>
+#  include <__cxx03/__config>
 #else
 #  include <__config>
+#endif
 
-#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#    pragma GCC system_header
-#  endif
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
 
 // TODO:
 // In the future, we should unconditionally include_next <wctype.h> here and instead
@@ -62,33 +63,32 @@ wctrans_t wctrans(const char* property);
 // nothing (with using_if_exists), and if we include another header that defines one
 // of these declarations (e.g. <wchar.h>), the second `using ::wint_t` with using_if_exists
 // will fail because it does not refer to the same declaration.
-#  if __has_include_next(<wctype.h>)
-#    include_next <wctype.h>
-#    define _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
-#  endif
+#if __has_include_next(<wctype.h>)
+#  include_next <wctype.h>
+#  define _LIBCPP_INCLUDED_C_LIBRARY_WCTYPE_H
+#endif
 
-#  ifdef __cplusplus
+#ifdef __cplusplus
 
-#    undef iswalnum
-#    undef iswalpha
-#    undef iswblank
-#    undef iswcntrl
-#    undef iswdigit
-#    undef iswgraph
-#    undef iswlower
-#    undef iswprint
-#    undef iswpunct
-#    undef iswspace
-#    undef iswupper
-#    undef iswxdigit
-#    undef iswctype
-#    undef wctype
-#    undef towlower
-#    undef towupper
-#    undef towctrans
-#    undef wctrans
+#  undef iswalnum
+#  undef iswalpha
+#  undef iswblank
+#  undef iswcntrl
+#  undef iswdigit
+#  undef iswgraph
+#  undef iswlower
+#  undef iswprint
+#  undef iswpunct
+#  undef iswspace
+#  undef iswupper
+#  undef iswxdigit
+#  undef iswctype
+#  undef wctype
+#  undef towlower
+#  undef towupper
+#  undef towctrans
+#  undef wctrans
 
-#  endif // __cplusplus
-#endif   // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
+#endif // __cplusplus
 
 #endif // _LIBCPP_WCTYPE_H



More information about the libcxx-commits mailing list