This patch provides the <foo.h> headers required by [depr.c.headers]. Previously, libc++ would rely on the underlying C library to provide these files, but it provides the C versions of the headers which typically miss some overloads required for a C++ standard library, and define macros that the C++ headers are not permitted to define.
I also removed some code which did this:
#ifdef isxdigit inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isxdigit(int __c) {return isxdigit(__c);} #undef isxdigit inline _LIBCPP_INLINE_VISIBILITY int isxdigit(int __c) {return __libcpp_isxdigit(__c);} #endif // isxdigit
This doesn't work when defining the function in the global namespace (there already is a function named isxdigit in that scope), and is not necessary for correctness -- the C standard requires that these symbols are defined as functions, even if there's a macro present. So instead we just use this:
#undef isxdigit
This theoretically produces slower code, in that the macro may do something that's faster than a function call. However, in at least glibc, the libc function is defined as an inline function anyway (when building at -O1 or above), so there is no actual difference.