diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -293,7 +293,6 @@ # if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__)) # define _LIBCPP_HAS_BITSCAN64 # endif -# define _LIBCPP_HAS_OPEN_WITH_WCHAR # if defined(_LIBCPP_MSVCRT) # define _LIBCPP_HAS_QUICK_EXIT # endif diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -231,9 +231,7 @@ _LIBCPP_INLINE_VISIBILITY bool is_open() const; basic_filebuf* open(const char* __s, ios_base::openmode __mode); -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR - basic_filebuf* open(const wchar_t* __s, ios_base::openmode __mode); -#endif + basic_filebuf* open(const wchar_t* __s, ios_base::openmode __mode); // EXTENSION _LIBCPP_INLINE_VISIBILITY basic_filebuf* open(const string& __s, ios_base::openmode __mode); @@ -591,12 +589,11 @@ return __rt; } -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR // This is basically the same as the char* overload except that it uses _wfopen // and long mode strings. template basic_filebuf<_CharT, _Traits>* -basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) +basic_filebuf<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) // EXTENSION { basic_filebuf<_CharT, _Traits>* __rt = nullptr; if (__file_ == nullptr) @@ -673,7 +670,6 @@ } return __rt; } -#endif template inline @@ -1139,10 +1135,8 @@ basic_ifstream(); _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in); -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR _LIBCPP_INLINE_VISIBILITY - explicit basic_ifstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in); -#endif + explicit basic_ifstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in); // EXTENSION _LIBCPP_INLINE_VISIBILITY explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in); #if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) @@ -1162,9 +1156,7 @@ _LIBCPP_INLINE_VISIBILITY bool is_open() const; void open(const char* __s, ios_base::openmode __mode = ios_base::in); -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR - void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in); -#endif + void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in); // EXTENSION void open(const string& __s, ios_base::openmode __mode = ios_base::in); #if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) _LIBCPP_AVAILABILITY_FILESYSTEM _LIBCPP_INLINE_VISIBILITY @@ -1199,16 +1191,14 @@ this->setstate(ios_base::failbit); } -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR template inline -basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t* __s, ios_base::openmode __mode) +basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t* __s, ios_base::openmode __mode) // EXTENSION : basic_istream(&__sb_) { if (__sb_.open(__s, __mode | ios_base::in) == nullptr) this->setstate(ios_base::failbit); } -#endif template inline @@ -1281,17 +1271,15 @@ this->setstate(ios_base::failbit); } -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR template void -basic_ifstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) +basic_ifstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) // EXTENSION { if (__sb_.open(__s, __mode | ios_base::in)) this->clear(); else this->setstate(ios_base::failbit); } -#endif template void @@ -1339,10 +1327,8 @@ basic_ofstream(); _LIBCPP_INLINE_VISIBILITY explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out); -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR _LIBCPP_INLINE_VISIBILITY - explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out); -#endif + explicit basic_ofstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::out); // EXTENSION _LIBCPP_INLINE_VISIBILITY explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out); @@ -1364,9 +1350,7 @@ _LIBCPP_INLINE_VISIBILITY bool is_open() const; void open(const char* __s, ios_base::openmode __mode = ios_base::out); -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR - void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::out); -#endif + void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::out); // EXTENSION void open(const string& __s, ios_base::openmode __mode = ios_base::out); #if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) @@ -1400,16 +1384,14 @@ this->setstate(ios_base::failbit); } -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR template inline -basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t* __s, ios_base::openmode __mode) +basic_ofstream<_CharT, _Traits>::basic_ofstream(const wchar_t* __s, ios_base::openmode __mode) // EXTENSION : basic_ostream(&__sb_) { if (__sb_.open(__s, __mode | ios_base::out) == nullptr) this->setstate(ios_base::failbit); } -#endif template inline @@ -1482,17 +1464,15 @@ this->setstate(ios_base::failbit); } -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR template void -basic_ofstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) +basic_ofstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) // EXTENSION { if (__sb_.open(__s, __mode | ios_base::out)) this->clear(); else this->setstate(ios_base::failbit); } -#endif template void @@ -1540,10 +1520,8 @@ basic_fstream(); _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR _LIBCPP_INLINE_VISIBILITY - explicit basic_fstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); -#endif + explicit basic_fstream(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); // EXTENSION _LIBCPP_INLINE_VISIBILITY explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); @@ -1567,9 +1545,7 @@ _LIBCPP_INLINE_VISIBILITY bool is_open() const; void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR - void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); -#endif + void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out); // EXTENSION void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out); #if _LIBCPP_STD_VER >= 17 && !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) @@ -1601,16 +1577,14 @@ this->setstate(ios_base::failbit); } -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR template inline -basic_fstream<_CharT, _Traits>::basic_fstream(const wchar_t* __s, ios_base::openmode __mode) +basic_fstream<_CharT, _Traits>::basic_fstream(const wchar_t* __s, ios_base::openmode __mode) // EXTENSION : basic_iostream(&__sb_) { if (__sb_.open(__s, __mode) == nullptr) this->setstate(ios_base::failbit); } -#endif template inline @@ -1683,17 +1657,15 @@ this->setstate(ios_base::failbit); } -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR template void -basic_fstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) +basic_fstream<_CharT, _Traits>::open(const wchar_t* __s, ios_base::openmode __mode) // EXTENSION { if (__sb_.open(__s, __mode)) this->clear(); else this->setstate(ios_base::failbit); } -#endif template void diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.cons/wchar_pointer.pass.cpp @@ -20,7 +20,6 @@ int main(int, char**) { -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR std::wstring temp = get_wide_temp_file_name(); { std::fstream fs(temp.c_str(), std::ios_base::in | std::ios_base::out @@ -42,7 +41,6 @@ assert(x == 3.25); } _wremove(temp.c_str()); -#endif - return 0; + return 0; } diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/fstream.members/open_wchar_pointer.pass.cpp @@ -20,7 +20,6 @@ int main(int, char**) { -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR std::wstring temp = get_wide_temp_file_name(); { std::fstream fs; @@ -48,7 +47,6 @@ assert(x == 3.25); } _wremove(temp.c_str()); -#endif - return 0; + return 0; } diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.cons/wchar_pointer.pass.cpp @@ -22,7 +22,6 @@ int main(int, char**) { -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR { std::ifstream fs(L"test.dat"); double x = 0; @@ -41,7 +40,6 @@ // std::wifstream(const wchar_t*, std::ios_base::openmode) is tested in // test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp // which creates writable files. -#endif - return 0; + return 0; } diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/ifstream.members/open_wchar_pointer.pass.cpp @@ -22,7 +22,6 @@ int main(int, char**) { -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR { std::ifstream fs; assert(!fs.is_open()); @@ -47,7 +46,6 @@ fs >> c; assert(c == L'r'); } -#endif - return 0; + return 0; } diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.cons/wchar_pointer.pass.cpp @@ -20,7 +20,6 @@ int main(int, char**) { -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR std::wstring temp = get_wide_temp_file_name(); { std::ofstream fs(temp.c_str()); @@ -56,7 +55,6 @@ assert(x == 3.25); } _wremove(temp.c_str()); -#endif - return 0; + return 0; } diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/ofstream.members/open_wchar_pointer.pass.cpp @@ -20,7 +20,6 @@ int main(int, char**) { -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR std::wstring temp = get_wide_temp_file_name(); { std::ofstream fs; @@ -56,7 +55,6 @@ assert(c == L'a'); } _wremove(temp.c_str()); -#endif - return 0; + return 0; } diff --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h --- a/libcxx/test/support/platform_support.h +++ b/libcxx/test/support/platform_support.h @@ -89,14 +89,12 @@ #endif } -#ifdef _LIBCPP_HAS_OPEN_WITH_WCHAR inline std::wstring get_wide_temp_file_name() { return std::wstring_convert >().from_bytes( get_temp_file_name()); } -#endif // _LIBCPP_HAS_OPEN_WITH_WCHAR #if defined(_CS_GNU_LIBC_VERSION) inline bool glibc_version_less_than(char const* version) {