This patch refactors and tries to remove as much of the Windows support headers as possible. This is needed because they currently introduce super weird include cycles and dependencies between STL and libc headers.
The changes in this patch are:
- remove support/win32/support.h completely. The required parts have either been moved into support/win32/msvc_support.h (for MSVC only helpers not needed by Clang), or directly into their respective foo.h headers.
- Combine locale_win32.h and locale_mgmt_win32.h into a single headers, this header should only be included within __locale or locale to avoid include cycles.
- Remove the unneeded parts of limits_win32.h and re-name it to limits_msvc_win32.h since it's only needed by Clang.
I've tested this patch using Clang on Windows, but I suspect it might technically regress our non-existent support for MSVC. Is somebody able to double check?
This refactor is needed to support upcoming fixes to <locale> on Windows.
I can see this helping when we are build libc++, but I don't think it helps client apps. They could have included windows.h before including our headers.
Don't get me wrong, I dislike the min and max macros, and bear no hard feelings towards people that define this project wide on the command line, I'm just not sure it will get things done right here.
In the past, I've just surrounded my min and max declarations with parenthesis to suppress macro expansion.