From 85274ba282dd474e64eb4d6ae73e6fc6ab2ea8a6 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 16 Jun 2022 07:58:46 +0700 Subject: [PATCH] When wchar_t is a real type, users shouldn't see unsigned short machinery (#2164) --- stl/inc/fstream | 44 +++++++++---------- stl/inc/iosfwd | 9 +--- stl/inc/locale | 3 +- stl/inc/xlocale | 24 +++++----- stl/inc/xlocmes | 3 +- stl/inc/xlocmon | 9 ++-- stl/inc/xlocnum | 9 ++-- stl/inc/xloctime | 6 +-- stl/inc/xstring | 4 +- stl/src/ushcerr.cpp | 8 ++++ stl/src/ushcin.cpp | 8 ++++ stl/src/ushclog.cpp | 8 ++++ stl/src/ushcout.cpp | 8 ++++ stl/src/ushiostr.cpp | 8 ++++ .../tests/VSO_0397980_codecvt_length/test.cpp | 3 ++ 15 files changed, 91 insertions(+), 63 deletions(-) diff --git a/stl/inc/fstream b/stl/inc/fstream index c341788d0e..d8454a7f1b 100644 --- a/stl/inc/fstream +++ b/stl/inc/fstream @@ -63,9 +63,9 @@ _INLINE_VAR constexpr bool _Is_any_path = _Is_any_of_v<_Ty _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const char*, ios_base::openmode, int); _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, ios_base::openmode, int); -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const unsigned short*, ios_base::openmode, int); -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD template bool _Fgetc(_Elem& _Ch, FILE* _File) { // get an element from a C stream @@ -94,7 +94,7 @@ inline bool _Fgetc(wchar_t& _Wchar, FILE* _File) { // get a wchar_t element from } } -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD template <> inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned short element from a C stream wint_t _Meta; @@ -105,7 +105,7 @@ inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned sho return true; } } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD template bool _Fputc(_Elem _Ch, FILE* _File) { // put an element to a C stream @@ -122,12 +122,12 @@ inline bool _Fputc(wchar_t _Wchar, FILE* _File) { // put a wchar_t element to a return _CSTD fputwc(_Wchar, _File) != WEOF; } -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD template <> inline bool _Fputc(unsigned short _Wchar, FILE* _File) { // put an unsigned short element to a C stream return _CSTD fputwc(_Wchar, _File) != WEOF; } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD template bool _Ungetc(const _Elem&, FILE*) { // put back an arbitrary element to a C stream (always fail) @@ -154,12 +154,12 @@ inline bool _Ungetc(const wchar_t& _Wchar, FILE* _File) { // put back a wchar_t return _CSTD ungetwc(_Wchar, _File) != WEOF; } -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD template <> inline bool _Ungetc(const unsigned short& _Wchar, FILE* _File) { // put back an unsigned short element to a C stream return _CSTD ungetwc(_Wchar, _File) != WEOF; } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD template class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream @@ -353,7 +353,7 @@ public: } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD basic_filebuf* open( const unsigned short* _Filename, ios_base::openmode _Mode, int _Prot = ios_base::_Default_open_prot) { // in standard as const std::filesystem::path::value_type *; _Prot is an extension @@ -377,7 +377,7 @@ public: return open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD basic_filebuf* close() { basic_filebuf* _Ans; @@ -842,7 +842,7 @@ public: const _Ty& _Path, ios_base::openmode _Mode = ios_base::in, int _Prot = ios_base::_Default_open_prot) : basic_ifstream(_Path.c_str(), _Mode, _Prot) {} // _Prot is an extension -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD explicit basic_ifstream(const unsigned short* _Filename, ios_base::openmode _Mode = ios_base::in, int _Prot = ios_base::_Default_open_prot) : _Mybase(_STD addressof(_Filebuffer)) { @@ -851,7 +851,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD explicit basic_ifstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -921,7 +921,7 @@ public: } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD void open(const unsigned short* _Filename, ios_base::openmode _Mode = ios_base::in, int _Prot = ios_base::_Default_open_prot) { // in standard as const std::filesystem::path::value_type *; _Prot is an extension @@ -938,7 +938,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD __CLR_OR_THIS_CALL ~basic_ifstream() noexcept override {} @@ -1025,7 +1025,7 @@ public: const _Ty& _Path, ios_base::openmode _Mode = ios_base::out, int _Prot = ios_base::_Default_open_prot) : basic_ofstream(_Path.c_str(), _Mode, _Prot) {} // _Prot is an extension -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD explicit basic_ofstream(const unsigned short* _Filename, ios_base::openmode _Mode = ios_base::out, int _Prot = ios_base::_Default_open_prot) : _Mybase(_STD addressof(_Filebuffer)) { @@ -1034,7 +1034,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD explicit basic_ofstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -1104,7 +1104,7 @@ public: } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD void open(const unsigned short* _Filename, ios_base::openmode _Mode = ios_base::out, int _Prot = ios_base::_Default_open_prot) { // in standard as const std::filesystem::path::value_type *; _Prot is an extension @@ -1121,7 +1121,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD __CLR_OR_THIS_CALL ~basic_ofstream() noexcept override {} @@ -1213,7 +1213,7 @@ public: int _Prot = ios_base::_Default_open_prot) : basic_fstream(_Path.c_str(), _Mode, _Prot) {} // _Prot is an extension -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD explicit basic_fstream(const unsigned short* _Filename, ios_base::openmode _Mode = ios_base::in | ios_base::out, int _Prot = ios_base::_Default_open_prot) : _Mybase(_STD addressof(_Filebuffer)) { @@ -1222,7 +1222,7 @@ public: _Myios::setstate(ios_base::failbit); } } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD explicit basic_fstream(FILE* _File) : _Mybase(_STD addressof(_Filebuffer)), _Filebuffer(_File) {} // extension @@ -1293,7 +1293,7 @@ public: } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD void open(const unsigned short* _Filename, ios_base::openmode _Mode = ios_base::in | ios_base::out, int _Prot = ios_base::_Default_open_prot) { // in standard as const std::filesystem::path::value_type *; _Prot is an extension @@ -1310,7 +1310,7 @@ public: open(_Filename, static_cast(_Mode)); } #endif // _HAS_OLD_IOSTREAMS_MEMBERS -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD __CLR_OR_THIS_CALL ~basic_fstream() noexcept override {} diff --git a/stl/inc/iosfwd b/stl/inc/iosfwd index 5d6b1dfa44..2462b10426 100644 --- a/stl/inc/iosfwd +++ b/stl/inc/iosfwd @@ -160,10 +160,10 @@ template <> struct char_traits; template <> struct char_traits; -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD template <> struct char_traits; -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD template class allocator; @@ -278,11 +278,6 @@ using wospanstream = basic_ospanstream; using wspanstream = basic_spanstream; #endif // _HAS_CXX23 -#if defined(_CRTBLD) -using ushistream = basic_istream>; -using ushostream = basic_ostream>; -using ushfilebuf = basic_filebuf>; -#endif // defined(_CRTBLD) _STD_END #pragma pop_macro("new") diff --git a/stl/inc/locale b/stl/inc/locale index 483c3027a1..c05ad26723 100644 --- a/stl/inc/locale +++ b/stl/inc/locale @@ -26,8 +26,7 @@ _STD_BEGIN template class collate : public locale::facet { // facet for ordering sequences of elements public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); using char_type = _Elem; using string_type = basic_string<_Elem, char_traits<_Elem>, allocator<_Elem>>; diff --git a/stl/inc/xlocale b/stl/inc/xlocale index f9b7a1c8a6..1ed2bdcafb 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -200,10 +200,10 @@ public: static void __CLRCALL_OR_CDECL _Makewloc( const _Locinfo&, category, _Locimp*, const locale*); // make wchar_t facets -#ifdef _NATIVE_WCHAR_T_DEFINED +#if defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS static void __CLRCALL_OR_CDECL _Makeushloc( const _Locinfo&, category, _Locimp*, const locale*); // make ushort facets -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS static void __CLRCALL_OR_CDECL _Makexloc( const _Locinfo&, category, _Locimp*, const locale*); // make remaining facets @@ -472,7 +472,7 @@ inline char __CRTDECL _Maklocbyte(wchar_t _Char, const _Locinfo::_Cvtvec& _Cvt) return _Byte; } -#ifdef _NATIVE_WCHAR_T_DEFINED +#if defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template <> inline char __CRTDECL _Maklocbyte(unsigned short _Char, const _Locinfo::_Cvtvec& _Cvt) { // convert unsigned short to char using _Cvtvec @@ -481,7 +481,7 @@ inline char __CRTDECL _Maklocbyte(unsigned short _Char, const _Locinfo::_Cvtvec& _Wcrtomb(&_Byte, static_cast(_Char), &_Mbst1, &_Cvt); return _Byte; } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template _Elem __CRTDECL _Maklocchr(char _Byte, _Elem*, const _Locinfo::_Cvtvec&) { @@ -498,7 +498,7 @@ inline wchar_t __CRTDECL _Maklocchr(char _Byte, wchar_t*, const _Locinfo::_Cvtve return _Wc; } -#ifdef _NATIVE_WCHAR_T_DEFINED +#if defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template <> inline unsigned short __CRTDECL _Maklocchr(char _Byte, unsigned short*, const _Locinfo::_Cvtvec& _Cvt) { // convert char to unsigned short using _Cvtvec @@ -507,7 +507,7 @@ inline unsigned short __CRTDECL _Maklocchr(char _Byte, unsigned short*, const _L _Mbrtowc(reinterpret_cast(&_Wc), &_Byte, 1, &_Mbst1, &_Cvt); return _Wc; } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template _Elem* __CRTDECL _Maklocstr(const char* _Ptr, _Elem*, const _Locinfo::_Cvtvec&) { @@ -567,7 +567,7 @@ inline wchar_t* __CRTDECL _Maklocstr(const char* _Ptr, wchar_t*, const _Locinfo: return _Ptrdest; } -#ifdef _NATIVE_WCHAR_T_DEFINED +#if defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template <> inline unsigned short* __CRTDECL _Maklocstr(const char* _Ptr, unsigned short*, const _Locinfo::_Cvtvec& _Cvt) { // convert C string to unsigned short sequence using _Cvtvec @@ -605,7 +605,7 @@ inline unsigned short* __CRTDECL _Maklocstr(const char* _Ptr, unsigned short*, c *_Ptrnext = L'\0'; return reinterpret_cast(_Ptrdest); } -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS class _CRTIMP2_PURE_IMPORT codecvt_base : public locale::facet { // base class for codecvt public: @@ -2117,7 +2117,7 @@ private: _Locinfo::_Cvtvec _Cvt; // locale info passed to _Mbrtowc, _Wcrtomb }; -#ifdef _NATIVE_WCHAR_T_DEFINED +#if defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template <> class _CRTIMP2_PURE_IMPORT codecvt : public codecvt_base { // facet for converting between unsigned short and char sequences @@ -2317,7 +2317,7 @@ protected: private: _Locinfo::_Cvtvec _Cvt; // locale info passed to _Mbrtowc, _Wcrtomb }; -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template class codecvt_byname : public codecvt<_Elem, _Byte, _Statype> { // codecvt for named locale @@ -3005,7 +3005,7 @@ private: _Locinfo::_Cvtvec _Cvt; // conversion information }; -#ifdef _NATIVE_WCHAR_T_DEFINED +#if defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template <> class _CRTIMP2_PURE_IMPORT ctype : public ctype_base { // facet for classifying unsigned short elements, converting cases @@ -3211,7 +3211,7 @@ private: _Locinfo::_Ctypevec _Ctype; // locale info passed to _Tolower, etc. _Locinfo::_Cvtvec _Cvt; // conversion information }; -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // defined(_NATIVE_WCHAR_T_DEFINED) && !_ENFORCE_FACET_SPECIALIZATIONS template class ctype_byname : public ctype<_Elem> { // ctype for named locale diff --git a/stl/inc/xlocmes b/stl/inc/xlocmes index bab3b35975..b18070fa08 100644 --- a/stl/inc/xlocmes +++ b/stl/inc/xlocmes @@ -27,8 +27,7 @@ struct messages_base : locale::facet { // base class for messages template class messages : public messages_base { // facet for obtaining messages from a catalog public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); using char_type = _Elem; using string_type = basic_string<_Elem, char_traits<_Elem>, allocator<_Elem>>; diff --git a/stl/inc/xlocmon b/stl/inc/xlocmon index 440bbbb182..008cf5ee12 100644 --- a/stl/inc/xlocmon +++ b/stl/inc/xlocmon @@ -244,8 +244,7 @@ private: template class moneypunct : public _Mpunct<_Elem> { // facet for defining monetary punctuation text public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); _PGLOBAL _CRTIMP2_PURE_IMPORT static const bool intl; // true if international __PURE_APPDOMAIN_GLOBAL _CRTIMP2_PURE_IMPORT static locale::id id; // unique facet id @@ -307,8 +306,7 @@ private: using _Mypunct1 = moneypunct<_Elem, true>; public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); using char_type = _Elem; using iter_type = _InIt; @@ -612,8 +610,7 @@ private: using _Mypunct1 = moneypunct<_Elem, true>; public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); using char_type = _Elem; using iter_type = _OutIt; diff --git a/stl/inc/xlocnum b/stl/inc/xlocnum index 5e272e75a8..2b919f04ff 100644 --- a/stl/inc/xlocnum +++ b/stl/inc/xlocnum @@ -98,8 +98,7 @@ private: friend _Tidy_guard; public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); using string_type = basic_string<_Elem, char_traits<_Elem>, allocator<_Elem>>; using char_type = _Elem; @@ -259,8 +258,7 @@ __PURE_APPDOMAIN_GLOBAL locale::id numpunct<_Elem>::id; template >> class num_get : public locale::facet { // facet for converting text to encoded numbers public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) { // return locale category mask and construct standard facet @@ -1166,8 +1164,7 @@ int _Float_put_desired_precision(const streamsize _Precision, const ios_base::fm template >> class num_put : public locale::facet { // facet for converting encoded numbers to text public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); static size_t __CLRCALL_OR_CDECL _Getcat(const locale::facet** _Ppf = nullptr, const locale* _Ploc = nullptr) { // return locale category mask and construct standard facet diff --git a/stl/inc/xloctime b/stl/inc/xloctime index da4f55a9ae..06652fd4c3 100644 --- a/stl/inc/xloctime +++ b/stl/inc/xloctime @@ -106,8 +106,7 @@ private: friend _Tidy_guard; public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); using char_type = _Elem; using iter_type = _InIt; @@ -649,8 +648,7 @@ protected: template >> class time_put : public locale::facet { // facet for converting encoded times to text public: - static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t, unsigned short>, - _FACET_SPECIALIZATION_MESSAGE); + static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); using char_type = _Elem; using iter_type = _OutIt; diff --git a/stl/inc/xstring b/stl/inc/xstring index 8c684942bb..395ec12aec 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -341,10 +341,10 @@ struct char_traits : _Char_traits {}; template <> struct char_traits : _WChar_traits {}; -#ifdef _NATIVE_WCHAR_T_DEFINED +#ifdef _CRTBLD template <> struct char_traits : _WChar_traits {}; -#endif // _NATIVE_WCHAR_T_DEFINED +#endif // _CRTBLD #if defined(__cpp_char8_t) && !defined(__EDG__) && !defined(__clang__) #define _HAS_U8_INTRINSICS 1 diff --git a/stl/src/ushcerr.cpp b/stl/src/ushcerr.cpp index 2b57692561..b813d0d27e 100644 --- a/stl/src/ushcerr.cpp +++ b/stl/src/ushcerr.cpp @@ -6,6 +6,14 @@ #ifdef _NATIVE_WCHAR_T_DEFINED #include +_STD_BEGIN + +using ushistream = basic_istream>; +using ushostream = basic_ostream>; +using ushfilebuf = basic_filebuf>; + +_STD_END + #ifndef wistream #define wistream ushistream #define wostream ushostream diff --git a/stl/src/ushcin.cpp b/stl/src/ushcin.cpp index 5af2eb0183..3323192726 100644 --- a/stl/src/ushcin.cpp +++ b/stl/src/ushcin.cpp @@ -6,6 +6,14 @@ #ifdef _NATIVE_WCHAR_T_DEFINED #include +_STD_BEGIN + +using ushistream = basic_istream>; +using ushostream = basic_ostream>; +using ushfilebuf = basic_filebuf>; + +_STD_END + #ifndef wistream #define wistream ushistream #define wostream ushostream diff --git a/stl/src/ushclog.cpp b/stl/src/ushclog.cpp index 8e0a16c15d..08895621c9 100644 --- a/stl/src/ushclog.cpp +++ b/stl/src/ushclog.cpp @@ -6,6 +6,14 @@ #ifdef _NATIVE_WCHAR_T_DEFINED #include +_STD_BEGIN + +using ushistream = basic_istream>; +using ushostream = basic_ostream>; +using ushfilebuf = basic_filebuf>; + +_STD_END + #ifndef wistream #define wistream ushistream #define wostream ushostream diff --git a/stl/src/ushcout.cpp b/stl/src/ushcout.cpp index 2f81fae7b2..30e1b45fca 100644 --- a/stl/src/ushcout.cpp +++ b/stl/src/ushcout.cpp @@ -6,6 +6,14 @@ #ifdef _NATIVE_WCHAR_T_DEFINED #include +_STD_BEGIN + +using ushistream = basic_istream>; +using ushostream = basic_ostream>; +using ushfilebuf = basic_filebuf>; + +_STD_END + #ifndef wistream #define wistream ushistream #define wostream ushostream diff --git a/stl/src/ushiostr.cpp b/stl/src/ushiostr.cpp index 072766538a..ea77e56530 100644 --- a/stl/src/ushiostr.cpp +++ b/stl/src/ushiostr.cpp @@ -6,6 +6,14 @@ #ifdef _NATIVE_WCHAR_T_DEFINED #include +_STD_BEGIN + +using ushistream = basic_istream>; +using ushostream = basic_ostream>; +using ushfilebuf = basic_filebuf>; + +_STD_END + #define wistream ushistream #define wostream ushostream #define wfilebuf ushfilebuf diff --git a/tests/std/tests/VSO_0397980_codecvt_length/test.cpp b/tests/std/tests/VSO_0397980_codecvt_length/test.cpp index f18b6197ac..e1d23def99 100644 --- a/tests/std/tests/VSO_0397980_codecvt_length/test.cpp +++ b/tests/std/tests/VSO_0397980_codecvt_length/test.cpp @@ -4,6 +4,9 @@ #define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING #define _SILENCE_CXX20_CODECVT_FACETS_DEPRECATION_WARNING +#undef _ENFORCE_FACET_SPECIALIZATIONS +#define _ENFORCE_FACET_SPECIALIZATIONS 0 + #include #include #include