diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-02 18:41:48 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-02 18:41:48 +0000 |
commit | 8bcade547a7be1aa81e9ed2c81b3e120d6a620bb (patch) | |
tree | 5d3b99efb17a1407500649b4f239da246f6064c1 /libcxx/include/support | |
parent | 841261624dd05d33cf1075c4ec0a99cd2d2381c7 (diff) | |
download | bcm5719-llvm-8bcade547a7be1aa81e9ed2c81b3e120d6a620bb.tar.gz bcm5719-llvm-8bcade547a7be1aa81e9ed2c81b3e120d6a620bb.zip |
locale: update ctype access for MSVC CRT 14+
Visual C++ 14 and newer split msvcrt into msvcrt and ucrt with flavours
of the ucrt for different environments. This changed the access to the
ctype table by introducing the `__pctype_func` and `__pwctype_func`
accessors. Use this rather than directly accessing `_ctype` which
allows us to be safer in threaded situations by going through the libc
locking.
llvm-svn: 290823
Diffstat (limited to 'libcxx/include/support')
-rw-r--r-- | libcxx/include/support/win32/locale_win32.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libcxx/include/support/win32/locale_win32.h b/libcxx/include/support/win32/locale_win32.h index 0f5527e570a..ebf5bda740a 100644 --- a/libcxx/include/support/win32/locale_win32.h +++ b/libcxx/include/support/win32/locale_win32.h @@ -11,8 +11,12 @@ #ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H #define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H +#include <crtversion.h> + +#if _VC_CRT_MAJOR_VERSION < 14 // ctype mask table defined in msvcrt.dll -extern "C" unsigned short __declspec(dllimport) _ctype[]; +extern "C" unsigned short __declspec(dllimport) _ctype[]; +#endif #include "support/win32/support.h" #include "support/win32/locale_mgmt_win32.h" |