[PATCH] D32988: [libc++] Refactor Windows support headers.

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 18:34:12 PDT 2017


EricWF created this revision.

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.


https://reviews.llvm.org/D32988

Files:
  include/__config
  include/algorithm
  include/ctype.h
  include/limits
  include/stdio.h
  include/stdlib.h
  include/support/win32/limits_msvc_win32.h
  include/support/win32/limits_win32.h
  include/support/win32/locale_mgmt_win32.h
  include/support/win32/locale_win32.h
  include/support/win32/msvc_support.h
  include/support/win32/support.h
  include/wchar.h
  src/string.cpp
  src/support/runtime/exception_pointer_msvc.ipp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32988.98242.patch
Type: text/x-patch
Size: 25744 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170509/35edff0c/attachment-0001.bin>


More information about the cfe-commits mailing list