Skip to content

Commit

Permalink
Merge pull request #24 from wx257osn2/fix-qoiconv-for-windows
Browse files Browse the repository at this point in the history
Fix qoiconv for windows
  • Loading branch information
wx257osn2 authored Feb 24, 2024
2 parents 2a60261 + e3cc04e commit be83dde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/qoibench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include<filesystem>
#include<string_view>
#include<ranges>
#include<fstream>
#include<cstddef>
#include<vector>
#include<memory>
Expand Down
4 changes: 2 additions & 2 deletions src/qoiconv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@

static inline std::vector<std::byte> load_file(const std::filesystem::path& path){
std::vector<std::byte> bytes(std::filesystem::file_size(path));
std::ifstream ifs{path};
std::ifstream ifs{path, std::ios::binary};
ifs.read(reinterpret_cast<char*>(bytes.data()), bytes.size());
return bytes;
}

static inline void save_file(const std::filesystem::path& path, const std::vector<std::byte>& bytes){
std::ofstream ofs{path};
std::ofstream ofs{path, std::ios::binary};
ofs.write(reinterpret_cast<const char*>(bytes.data()), bytes.size());
}

Expand Down

0 comments on commit be83dde

Please sign in to comment.