fuck macos

This commit is contained in:
lizzie 2025-12-07 00:17:47 +00:00
parent a361a6eb7f
commit 9db2b59014

View file

@ -274,9 +274,9 @@ void IOFile::Open(const fs::path& path, FileAccessMode mode, FileType type, File
} else { } else {
file = std::fopen(path.c_str(), AccessModeToStr(mode, type)); file = std::fopen(path.c_str(), AccessModeToStr(mode, type));
} }
#elif defined(__HAIKU__) || defined(__managarm__) || defined(__OPENORBIS__) #elif defined(__HAIKU__) || defined(__managarm__) || defined(__OPENORBIS__) || defined(__APPLE__)
file = std::fopen(path.c_str(), AccessModeToStr(mode, type)); file = std::fopen(path.c_str(), AccessModeToStr(mode, type));
#else #elif defined(__unix__)
if (type == FileType::BinaryFile && mode == FileAccessMode::Read) { if (type == FileType::BinaryFile && mode == FileAccessMode::Read) {
struct stat st; struct stat st;
mmap_fd = open(path.c_str(), O_RDONLY); mmap_fd = open(path.c_str(), O_RDONLY);
@ -327,6 +327,9 @@ void IOFile::Open(const fs::path& path, FileAccessMode mode, FileType type, File
if (mmap_fd == -1) { if (mmap_fd == -1) {
file = std::fopen(path.c_str(), AccessModeToStr(mode, type)); file = std::fopen(path.c_str(), AccessModeToStr(mode, type));
} }
#else
// Some other fancy OS (ahem fucking Darwin/Mac OSX)
file = std::fopen(path.c_str(), AccessModeToStr(mode, type));
#endif #endif
if (!IsOpen()) { if (!IsOpen()) {
const auto ec = std::error_code{errno, std::generic_category()}; const auto ec = std::error_code{errno, std::generic_category()};