diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-05-10 20:57:45 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-05-10 20:57:45 +0000 |
commit | 41af64afad4ac5525e7fc0a506915124f126c0ca (patch) | |
tree | f23b512d3225822f9e983d5f1d2c5a3d300a545f /src/string.cpp | |
parent | 76515a2dcf907cf99c98362f306e1b9fa317023e (diff) |
[libc++] Refactor Windows support headers.
Summary:
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.
Reviewers: bcraig, rmaprath, compnerd, EricWF
Reviewed By: EricWF
Subscribers: majnemer, cfe-commits
Differential Revision: https://reviews.llvm.org/D32988
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302727 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/string.cpp')
-rw-r--r-- | src/string.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/string.cpp b/src/string.cpp index cd644330b..d7ebdd3e5 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -13,9 +13,6 @@ #include "cerrno" #include "limits" #include "stdexcept" -#ifdef _LIBCPP_MSVCRT -#include "support/win32/support.h" -#endif // _LIBCPP_MSVCRT #include <stdio.h> _LIBCPP_BEGIN_NAMESPACE_STD @@ -430,7 +427,7 @@ get_swprintf() #ifndef _LIBCPP_MSVCRT return swprintf; #else - return static_cast<int (__cdecl*)(wchar_t* __restrict, size_t, const wchar_t*__restrict, ...)>(swprintf); + return static_cast<int (__cdecl*)(wchar_t* __restrict, size_t, const wchar_t*__restrict, ...)>(_snwprintf); #endif } |