diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-02 21:09:16 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-02 21:09:16 +0000 |
commit | 11c0c53367efbcc8d54ff26c562e8b7891ebc1b1 (patch) | |
tree | 1ce0b24087db295b00942eb40622174ef72d2cd7 /libcxx/src | |
parent | e205d766f0df10a3d0ef738a2ba2472f8deade0f (diff) | |
download | bcm5719-llvm-11c0c53367efbcc8d54ff26c562e8b7891ebc1b1.tar.gz bcm5719-llvm-11c0c53367efbcc8d54ff26c562e8b7891ebc1b1.zip |
win32: temporarily disable setting locale on 14+
The locale structures have been made opaque in CRT 14+. This currently
prevents building libc++ for Windows. We can re-enable this in the
future when we have replicated the structure to access the private field
for the name (unless there exists a better supported mechanism to query
the name of a locale given the locale_t).
llvm-svn: 290835
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/support/win32/locale_win32.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/src/support/win32/locale_win32.cpp b/libcxx/src/support/win32/locale_win32.cpp index 7300451101e..ee138111715 100644 --- a/libcxx/src/support/win32/locale_win32.cpp +++ b/libcxx/src/support/win32/locale_win32.cpp @@ -13,6 +13,8 @@ #include <memory> #include <type_traits> +#include <crtversion.h> + typedef _VSTD::remove_pointer<locale_t>::type __locale_struct; typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii; @@ -29,7 +31,9 @@ locale_t uselocale( locale_t newloc ) // uselocale sets the thread's locale by definition, so unconditionally use thread-local locale _configthreadlocale( _ENABLE_PER_THREAD_LOCALE ); // uselocale sets all categories +#if _VC_CRT_MAJOR_VERSION < 14 setlocale( LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale ); +#endif // uselocale returns the old locale_t return old_locale; } |