Remove the use of microsoft STL extension in file.cpp#8045
Remove the use of microsoft STL extension in file.cpp#8045FatihBAKIR wants to merge 1 commit intoWebAssembly:mainfrom
Conversation
Standard std::[io]fstream does not have a constructor from `std::wstring`, but from `std::string` or `const wchar_t*`. Microsoft STL has an extension that supports a `std::wstring` constructor, which the current code depends on. However, that extension does not exist in libc++ and therefore fails when trying to use libc++ with clang-cl on Windows. This patch uses the standard-compliant constructor and builds with libc++.
|
Yeah, USE_WSTRING_PATH is certainly the thing that controls whether we try to use More generally I am interested in having support for using libc++ with windows; we ship our emsdk binaries with libc++ on the other platforms, so it might be nice to do that for Windows too. How good is the support for that these days? How are you configuring your build? |
Standard std::[io]fstream does not have a constructor from
std::wstring, but fromstd::stringorconst wchar_t*. Microsoft STL has an extension that supports astd::wstringconstructor, which the current code depends on. However, that extension does not exist in libc++ and therefore fails when trying to use libc++ with clang-cl on Windows.This patch uses the standard-compliant constructor and builds with libc++.
https://en.cppreference.com/w/cpp/io/basic_ifstream/basic_ifstream.html
https://en.cppreference.com/w/cpp/io/basic_ifstream/basic_ofstream.html