diff --git a/targets/java/src/InputOutputStream/FileInputStream.cpp b/targets/java/src/InputOutputStream/FileInputStream.cpp index 1522fdb58..a6d8d93a7 100644 --- a/targets/java/src/InputOutputStream/FileInputStream.cpp +++ b/targets/java/src/InputOutputStream/FileInputStream.cpp @@ -49,13 +49,9 @@ bool FileSeek(std::FILE* file, int64_t offset, int origin) { // SecurityException - if a security manager exists and its checkRead method // denies read access to the file. FileInputStream::FileInputStream(const File& file) : m_fileHandle(nullptr) { -#if defined(_WIN32) - m_fileHandle = _wfopen(file.getPath().c_str(), "rb"); -#else const std::string nativePath = std::filesystem::path(file.getPath()).string(); m_fileHandle = std::fopen(nativePath.c_str(), "rb"); -#endif if (m_fileHandle == nullptr) { assert(0); diff --git a/targets/java/src/InputOutputStream/FileOutputStream.cpp b/targets/java/src/InputOutputStream/FileOutputStream.cpp index 82db3bbac..ae8971a52 100644 --- a/targets/java/src/InputOutputStream/FileOutputStream.cpp +++ b/targets/java/src/InputOutputStream/FileOutputStream.cpp @@ -26,13 +26,9 @@ FileOutputStream::FileOutputStream(const File& file) : m_fileHandle(nullptr) { return; } -#if defined(_WIN32) - m_fileHandle = _wfopen(file.getPath().c_str(), "wb"); -#else const std::string nativePath = std::filesystem::path(file.getPath()).string(); m_fileHandle = std::fopen(nativePath.c_str(), "wb"); -#endif if (m_fileHandle == nullptr) { // TODO 4J Stu - Any form of error/exception handling diff --git a/targets/minecraft/world/level/chunk/storage/NbtSlotFile.cpp b/targets/minecraft/world/level/chunk/storage/NbtSlotFile.cpp index 325ba6ced..651032e1b 100644 --- a/targets/minecraft/world/level/chunk/storage/NbtSlotFile.cpp +++ b/targets/minecraft/world/level/chunk/storage/NbtSlotFile.cpp @@ -6,19 +6,12 @@ namespace { std::FILE* OpenBinaryFileForReadWrite(const File& file) { -#if defined(_WIN32) - std::FILE* stream = _wfopen(file.getPath().c_str(), "r+b"); - if (stream == nullptr) { - stream = _wfopen(file.getPath().c_str(), "w+b"); - } -#else const std::string nativePath = std::filesystem::path(file.getPath()).string(); std::FILE* stream = std::fopen(nativePath.c_str(), "r+b"); if (stream == nullptr) { stream = std::fopen(nativePath.c_str(), "w+b"); } -#endif return stream; } diff --git a/targets/minecraft/world/level/chunk/storage/ZoneFile.cpp b/targets/minecraft/world/level/chunk/storage/ZoneFile.cpp index cbf5e30ed..43ed2cece 100644 --- a/targets/minecraft/world/level/chunk/storage/ZoneFile.cpp +++ b/targets/minecraft/world/level/chunk/storage/ZoneFile.cpp @@ -7,19 +7,12 @@ namespace { std::FILE* OpenBinaryFileForReadWrite(const File& file) { -#if defined(_WIN32) - std::FILE* stream = _wfopen(file.getPath().c_str(), "r+b"); - if (stream == nullptr) { - stream = _wfopen(file.getPath().c_str(), "w+b"); - } -#else const std::string nativePath = std::filesystem::path(file.getPath()).string(); std::FILE* stream = std::fopen(nativePath.c_str(), "r+b"); if (stream == nullptr) { stream = std::fopen(nativePath.c_str(), "w+b"); } -#endif return stream; } } // namespace