Skip to content

Commit 11c0c53

Browse files
committed
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
1 parent e205d76 commit 11c0c53

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libcxx/src/support/win32/locale_win32.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <memory>
1414
#include <type_traits>
1515

16+
#include <crtversion.h>
17+
1618
typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
1719
typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
1820

@@ -29,7 +31,9 @@ locale_t uselocale( locale_t newloc )
2931
// uselocale sets the thread's locale by definition, so unconditionally use thread-local locale
3032
_configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
3133
// uselocale sets all categories
34+
#if _VC_CRT_MAJOR_VERSION < 14
3235
setlocale( LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale );
36+
#endif
3337
// uselocale returns the old locale_t
3438
return old_locale;
3539
}

0 commit comments

Comments
 (0)