Skip to content

Commit be83dde

Browse files
authoredFeb 24, 2024··
Merge pull request #24 from wx257osn2/fix-qoiconv-for-windows
Fix qoiconv for windows
2 parents 2a60261 + e3cc04e commit be83dde

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed
 

‎src/qoibench.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include<filesystem>
4040
#include<string_view>
4141
#include<ranges>
42-
#include<fstream>
4342
#include<cstddef>
4443
#include<vector>
4544
#include<memory>

‎src/qoiconv.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535

3636
static inline std::vector<std::byte> load_file(const std::filesystem::path& path){
3737
std::vector<std::byte> bytes(std::filesystem::file_size(path));
38-
std::ifstream ifs{path};
38+
std::ifstream ifs{path, std::ios::binary};
3939
ifs.read(reinterpret_cast<char*>(bytes.data()), bytes.size());
4040
return bytes;
4141
}
4242

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

0 commit comments

Comments
 (0)
Please sign in to comment.