Googletest export

Fix compile error from protected destructor of std::codecvt

PiperOrigin-RevId: 313584603
This commit is contained in:
dmauro 2020-05-28 10:43:11 -04:00 committed by Derek Mauro
parent 85a4631946
commit fd32ba66e2

View File

@ -2047,7 +2047,8 @@ inline int ChDir(const char* dir) { return chdir(dir); }
#endif
inline FILE* FOpen(const char* path, const char* mode) {
#if GTEST_OS_WINDOWS
std::wstring_convert<std::codecvt<wchar_t, char, std::mbstate_t>> converter;
struct wchar_codecvt : public std::codecvt<wchar_t, char, std::mbstate_t> {};
std::wstring_convert<wchar_codecvt> converter;
std::wstring wide_path = converter.from_bytes(path);
std::wstring wide_mode = converter.from_bytes(mode);
return _wfopen(wide_path.c_str(), wide_mode.c_str());