Fix MinGW code path reused linux code path.

This commit is contained in:
Syoyo Fujita 2019-11-10 15:31:17 +09:00
parent a471770f38
commit 4ab0386d09

View File

@ -7208,7 +7208,9 @@ static void WriteBinaryGltfFile(const std::string &output,
#if defined(_MSC_VER)
std::ofstream gltfFile(UTF8ToWchar(output).c_str(), std::ios::binary);
#elif defined(__GLIBCXX__)
std::ofstream gltfFile(output.c_str(), std::ios::binary);
int file_descriptor = _wopen(UTF8ToWchar(output).c_str(), _O_WRONLY | _O_BINARY);
__gnu_cxx::stdio_filebuf<char> wfile_buf(file_descriptor, std::ios_base::in);
std::ostream gltfFile(&wfile_buf);
#else
std::ofstream gltfFile(output.c_str(), std::ios::binary);
#endif