llvm-project/libcxx
Eric Fiselier b4ddab26bc Refactor <locale> RAII guards to aid upcoming Windows locale changes.
Previously <locale> used std::unique_ptr<remove_ptr<locale_t>, locale-mgmt-function>
as a scope guard for (A) creating new locales, and (B) setting the thread specific locale
in RAII safe manner.

However using unique_ptr has some problems, first it requires that locale_t is a pointer
type, which may not be the case (Windows will need a non-pointer locale_t type that emulates _locale_t).

The second problem is that users of the guards had to supply the locale management function to the custom
deleter at every call site. However these locale management functions don't exist natively Windows, making
a good Windows implementation of locale more difficult.

This patch creates distinct and simply RAII guards that replace unique_ptr. These guards handle calling
the correct locale management function so that callers don't have too. This simplification will
aid in upcoming Windows fixes.

llvm-svn: 302474
2017-05-08 22:02:43 +00:00
..
benchmarks Emit benchmark tests into the benchmarks build directory, not lib/ 2017-04-18 07:40:22 +00:00
cmake [CMake][libcxx] Fix the --target and --gcc-toolchain flag handling 2017-04-16 02:25:55 +00:00
docs Add markup for libc++ dylib availability 2017-05-04 17:08:54 +00:00
include Refactor <locale> RAII guards to aid upcoming Windows locale changes. 2017-05-08 22:02:43 +00:00
lib [libc++] Implement exception_ptr on Windows 2017-05-08 01:17:50 +00:00
src Refactor <locale> RAII guards to aid upcoming Windows locale changes. 2017-05-08 22:02:43 +00:00
test Fix possible loss of data warnings on amd64 2017-05-08 21:54:53 +00:00
utils Fix Windows tests when __config_site is present. 2017-05-08 13:15:22 +00:00
www Mark LWG#2788 as complete - we already do this 2017-04-18 17:22:49 +00:00
.arcconfig Upgrade arcconfig to use https 2016-07-18 02:02:49 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore Implement N4606 optional 2016-10-12 07:46:20 +00:00
CMakeLists.txt test commit 2017-05-04 06:28:34 +00:00
CREDITS.TXT Updated email address in `CREDITS.txt`. 2017-03-06 20:46:55 +00:00
LICENSE.TXT Update year to 2017 2017-01-03 11:20:43 +00:00
NOTES.TXT Update doc and various cleanup 2016-12-23 20:00:13 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00
appveyor.yml Change Appveyor to download Clang from llvm.org instead of my private server 2017-05-04 19:04:50 +00:00
install-appveyor-reqs.cmd Change Appveyor to download Clang from llvm.org instead of my private server 2017-05-04 19:04:50 +00:00