From c0993e9a4f772b633c2f98c65031ba6acdb2235f Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Sat, 24 Feb 2024 11:30:20 +0900 Subject: [PATCH 1/2] add missing std::ios::binary for windows --- src/qoiconv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qoiconv.cpp b/src/qoiconv.cpp index 84f8824..3f7819c 100644 --- a/src/qoiconv.cpp +++ b/src/qoiconv.cpp @@ -35,13 +35,13 @@ static inline std::vector load_file(const std::filesystem::path& path){ std::vector bytes(std::filesystem::file_size(path)); - std::ifstream ifs{path}; + std::ifstream ifs{path, std::ios::binary}; ifs.read(reinterpret_cast(bytes.data()), bytes.size()); return bytes; } static inline void save_file(const std::filesystem::path& path, const std::vector& bytes){ - std::ofstream ofs{path}; + std::ofstream ofs{path, std::ios::binary}; ofs.write(reinterpret_cast(bytes.data()), bytes.size()); } From e3cc04e746c46bce9d4e1a9ea61d0238e5246621 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Sat, 24 Feb 2024 11:30:27 +0900 Subject: [PATCH 2/2] remove unused include --- src/qoibench.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qoibench.cpp b/src/qoibench.cpp index c2e9bbf..2e5ade5 100644 --- a/src/qoibench.cpp +++ b/src/qoibench.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include