Skip to content
Commit 24812d8a authored by Thomas Anderson's avatar Thomas Anderson
Browse files

Fix and speedup __libcpp_locale_guard on Windows

The old implementation assumed the POSIX `setlocale()` API where the old
locale is returned.  On Windows, the _new_ locale is returned.  This meant
that `__libcpp_locale_guard` wasn't resetting the locale on destruction.

The new implementation fixes the above issue and takes advantage of
`setlocale(LC_ALL)` to reduce the number of calls, and also avoids setting
the locale at all if it's not necessary.

Differential Revision: https://reviews.llvm.org/D59572

llvm-svn: 357104
parent 7462303e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment