Fixed Windows/MSVC compilation.

This commit is contained in:
2024-06-26 10:05:32 +02:00
parent b10f250945
commit b1fa99428e
8 changed files with 41 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
#include "./stream.hpp"
#include <algorithm>
#include <array>
#include <cassert>
#include <limits>
@@ -143,6 +144,9 @@ StreamError FileStream::open(const char* path, FileOpenMode mode_)
case FileOpenMode::READ_WRITE:
modeStr = "r+b";
break;
default:
MIJIN_FATAL("Invalid value for mode.");
return StreamError::UNKNOWN_ERROR;
}
handle = std::fopen(path, modeStr); // NOLINT(cppcoreguidelines-owning-memory)
if (!handle && mode_ == FileOpenMode::READ_WRITE) {