stdarg.h:
- va_list - macos _va_list.h was duplicately defining va_list. Fixed by this ifndef _VA_LIST_T
- additionally define _VA_LIST_DEFINED because glibc stdio.h was duplicately defining va_list
stddef.h
- ptrdiff_t - wrap in _PTRDIFF_T_DEFINED to protect against mingw defining it twice
- size_t - protections against collisions with mingw
- wchar_t - protections against duplicate definition with mingw
All of these came up in real world scenarios when using libclang to parse .h files in the Zig project.
These are the patches that Zig has on top of libclang headers, and if this patch is merged, then
Zig project will be tracking clang trunk.
Super nit-picky but you could condense this a bit by using
and a single #endif (revert the addition of line 34).
It's arguably easier to understand intent instead of adding another level of nesting. Same thing goes for the other two sections.
Just a suggestion.