Libc++ tried accomodating systems that need to be able to define various
__need_FOO macros before including C library headers, however it does not
appear to be needed anymore in most cases. Indeed, glibc used to use that
system to conditionally provide definitions, however almost all instances
of these macros have been removed from glibc years ago.
This is a reapplication of 119cef40d18c, which was reverted in 3f65c8fcbe4e
because it broke some builders.
I don't believe this is true: running clang -nostdinc -P -E ~/llvm-project/clang/lib/Headers/stddef.h gives me the following output:
And running with -dD shows that NULL is also defined.
The only thing that explicitly needs a __need macro appears to be __need_wint_t (added in rGa8792e514a4e271a61b8cc7e3e39485fb00af2bf)