Commit Graph

4 Commits

Author SHA1 Message Date
Eric Fiselier
650a099d4b Add system header pragma to BSD locale fallback headers.
This prevent leaking warnings to the user about use of C++11
extensions in C++03.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309917 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-03 02:50:43 +00:00
Marshall Clow
daea5bc508 Add missing include to __bsd_locale_fallbacks.h. Fixes https://bugs.llvm.org/show_bug.cgi?id=33370
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305469 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 14:31:11 +00:00
Eric Fiselier
2ec6d3933a 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302474 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 22:02:43 +00:00
Ben Craig
fd556585b2 Reorganize _LIBCPP_LOCALE__L_EXTENSIONS
Instead of checking _LIBCPP_LOCALE_L_EXTENSIONS all over, instead check it
once, and define the various *_l symbols once. The private redirector symbol
names are all prefixed with _libcpp_* so that they won't conflict with user
symbols, and so they won't conflict with future C library symbols. In
particular, glibc likes providing private symbols such as __locale_t, so we
should follow a different naming pattern (like _libcpp_*) to avoid problems
on that front.

Tested on Linux with glibc. Hoping for the best on OSX and the various BSDs.

http://reviews.llvm.org/D17456


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@263016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09 15:39:39 +00:00