Skip to content

Commit

Permalink
mingw32 compat
Browse files Browse the repository at this point in the history
filesize is a uintmax_t in 32-bit systems, and needs casting here
  • Loading branch information
oschonrock committed Dec 18, 2024
1 parent b8f70c9 commit 249132c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/toc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void save(const std::filesystem::path& toc_filename) {
template <pw_type PwType>
void load(const std::filesystem::path& toc_filename) {
std::cout << fmt::format("loading table of contents: {}\n", toc_filename);
const auto toc_file_size = std::filesystem::file_size(toc_filename);
const auto toc_file_size = static_cast<std::size_t>(std::filesystem::file_size(toc_filename));
auto toc_stream = std::ifstream(toc_filename, std::ios_base::binary);
toc<PwType> = std::vector<toc_entry>(toc_file_size / sizeof(toc_entry));
toc_stream.read(reinterpret_cast<char*>(toc<PwType>.data()), // NOLINT reincast
Expand Down

0 comments on commit 249132c

Please sign in to comment.