mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-04-22 22:20:01 +08:00
Added the pmode argument to _wopen to fix the access permission on MinGW
This commit is contained in:
parent
b132612307
commit
22dfeab315
@ -3151,7 +3151,7 @@ bool WriteWholeFile(std::string *err, const std::string &filepath,
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#if defined(__GLIBCXX__) // mingw
|
#if defined(__GLIBCXX__) // mingw
|
||||||
int file_descriptor = _wopen(UTF8ToWchar(filepath).c_str(),
|
int file_descriptor = _wopen(UTF8ToWchar(filepath).c_str(),
|
||||||
_O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY);
|
_O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _S_IWRITE);
|
||||||
__gnu_cxx::stdio_filebuf<char> wfile_buf(
|
__gnu_cxx::stdio_filebuf<char> wfile_buf(
|
||||||
file_descriptor, std::ios_base::out | std::ios_base::binary);
|
file_descriptor, std::ios_base::out | std::ios_base::binary);
|
||||||
std::ostream f(&wfile_buf);
|
std::ostream f(&wfile_buf);
|
||||||
@ -7127,7 +7127,7 @@ static bool SerializeGltfBufferData(const std::vector<unsigned char> &data,
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#if defined(__GLIBCXX__) // mingw
|
#if defined(__GLIBCXX__) // mingw
|
||||||
int file_descriptor = _wopen(UTF8ToWchar(binFilename).c_str(),
|
int file_descriptor = _wopen(UTF8ToWchar(binFilename).c_str(),
|
||||||
_O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY);
|
_O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _S_IWRITE);
|
||||||
__gnu_cxx::stdio_filebuf<char> wfile_buf(
|
__gnu_cxx::stdio_filebuf<char> wfile_buf(
|
||||||
file_descriptor, std::ios_base::out | std::ios_base::binary);
|
file_descriptor, std::ios_base::out | std::ios_base::binary);
|
||||||
std::ostream output(&wfile_buf);
|
std::ostream output(&wfile_buf);
|
||||||
@ -8352,7 +8352,7 @@ static bool WriteGltfFile(const std::string &output,
|
|||||||
std::ofstream gltfFile(UTF8ToWchar(output).c_str());
|
std::ofstream gltfFile(UTF8ToWchar(output).c_str());
|
||||||
#elif defined(__GLIBCXX__)
|
#elif defined(__GLIBCXX__)
|
||||||
int file_descriptor = _wopen(UTF8ToWchar(output).c_str(),
|
int file_descriptor = _wopen(UTF8ToWchar(output).c_str(),
|
||||||
_O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY);
|
_O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _S_IWRITE);
|
||||||
__gnu_cxx::stdio_filebuf<char> wfile_buf(
|
__gnu_cxx::stdio_filebuf<char> wfile_buf(
|
||||||
file_descriptor, std::ios_base::out | std::ios_base::binary);
|
file_descriptor, std::ios_base::out | std::ios_base::binary);
|
||||||
std::ostream gltfFile(&wfile_buf);
|
std::ostream gltfFile(&wfile_buf);
|
||||||
@ -8437,7 +8437,7 @@ static bool WriteBinaryGltfFile(const std::string &output,
|
|||||||
std::ofstream gltfFile(UTF8ToWchar(output).c_str(), std::ios::binary);
|
std::ofstream gltfFile(UTF8ToWchar(output).c_str(), std::ios::binary);
|
||||||
#elif defined(__GLIBCXX__)
|
#elif defined(__GLIBCXX__)
|
||||||
int file_descriptor = _wopen(UTF8ToWchar(output).c_str(),
|
int file_descriptor = _wopen(UTF8ToWchar(output).c_str(),
|
||||||
_O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY);
|
_O_CREAT | _O_WRONLY | _O_TRUNC | _O_BINARY, _S_IWRITE);
|
||||||
__gnu_cxx::stdio_filebuf<char> wfile_buf(
|
__gnu_cxx::stdio_filebuf<char> wfile_buf(
|
||||||
file_descriptor, std::ios_base::out | std::ios_base::binary);
|
file_descriptor, std::ios_base::out | std::ios_base::binary);
|
||||||
std::ostream gltfFile(&wfile_buf);
|
std::ostream gltfFile(&wfile_buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user