Switch to ANSI Windows API in fsbridge::fopen() function
This commit is contained in:
1 file changed
+1
-3
+1
-3
@@ -12,7 +12,6 @@
|
|||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
#include <codecvt>
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -28,8 +27,7 @@ FILE *fopen(const fs::path& p, const char *mode)
|
|||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
return ::fopen(p.c_str(), mode);
|
return ::fopen(p.c_str(), mode);
|
||||||
#else
|
#else
|
||||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,wchar_t> utf8_cvt;
|
return ::fopen(p.utf8string().c_str(), mode);
|
||||||
return ::_wfopen(p.wstring().c_str(), utf8_cvt.from_bytes(mode).c_str());
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user