llvm-project/libcxx/src
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
..
experimental Fix remaining GCC 7 build warnings 2017-05-05 20:39:03 +00:00
include Refer to _LIBCPP_MSVC macro where applicable 2017-02-06 05:26:49 +00:00
support Refactor <locale> RAII guards to aid upcoming Windows locale changes. 2017-05-08 22:02:43 +00:00
algorithm.cpp Mark libc++ internal globals with _LIBCPP_SAFE_STATIC. 2016-09-28 22:08:13 +00:00
any.cpp [libcxx] Add std::any 2016-08-11 03:13:11 +00:00
bind.cpp Implement LWG 2488 - Make the placeholders constexpr. 2016-06-26 21:01:34 +00:00
chrono.cpp [Chrono][Darwin] Include header for gettimeofday 2017-01-10 00:51:02 +00:00
condition_variable.cpp Recommit [libcxx] Never use <cassert> within libc++ 2017-02-04 23:22:28 +00:00
debug.cpp Fix debug mode build w/o exceptions 2016-12-28 05:20:27 +00:00
exception.cpp [libc++] Implement exception_ptr on Windows 2017-05-08 01:17:50 +00:00
functional.cpp [libc++] Add a key function for bad_function_call 2017-03-28 19:33:31 +00:00
future.cpp Make it possible to build a no-exceptions variant of libcxx. 2015-11-10 11:41:22 +00:00
hash.cpp Fix typos 2014-05-15 11:27:39 +00:00
ios.cpp [libc++] Fix extern template visibility for Windows 2016-09-19 18:29:07 +00:00
iostream.cpp [libc++] Use _LIBCPP_ABI_MICROSOFT instead of _MSC_VER 2017-04-19 20:11:04 +00:00
locale.cpp Refactor <locale> RAII guards to aid upcoming Windows locale changes. 2017-05-08 22:02:43 +00:00
memory.cpp Fix incorrect usage of __libcpp_mutex_trylock. Patch from Andrey Khalyavin 2017-05-04 07:45:09 +00:00
mutex.cpp Recommit [libcxx] Never use <cassert> within libc++ 2017-02-04 23:22:28 +00:00
new.cpp [libc++] Add option to disable new/delete overloads when libc++abi provides them. 2017-03-02 19:35:33 +00:00
optional.cpp Restore the _NOEXCEPT on the dtor of bad_optional_access. Destructors are noexcept by default, so it's not really needed, but the other exception classes have the _NOEXCEPT, and gcc complains if these are missing. I think we should remove them all - but not today. 2017-02-05 20:52:32 +00:00
random.cpp random: include __config before building 2016-12-31 00:00:21 +00:00
regex.cpp [libcxx] Remove pragmas that were needed to suppress warnings produced 2016-01-28 06:13:36 +00:00
shared_mutex.cpp Implement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480 2015-06-30 14:04:14 +00:00
stdexcept.cpp Recommit r290839 - Fix configuring and building libc++ w/o an ABI library. 2017-01-03 01:18:48 +00:00
string.cpp Revert r284193 - it is not correct on OS X 2016-10-14 04:21:24 +00:00
strstream.cpp Fix or suppress GCC warnings during build. 2016-08-29 20:43:38 +00:00
system_error.cpp Recommit [libcxx] Never use <cassert> within libc++ 2017-02-04 23:22:28 +00:00
thread.cpp [libcxx] Support threads on Fuchsia 2017-03-01 03:09:18 +00:00
typeinfo.cpp Fix yet another Apple buildit bug 2017-02-10 09:25:15 +00:00
utility.cpp
valarray.cpp Revert "Turn off extern templates for most uses." 2014-08-15 17:58:56 +00:00
variant.cpp Implement C++17 <variant>. Patch from Michael Park! 2016-12-02 23:00:05 +00:00