fix: compilation on windows

This commit is contained in:
Jan 2025-01-02 22:15:11 +01:00
parent dfd6e4117c
commit 9097db7d0f
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C

View File

@ -30,7 +30,7 @@ void IwdToCreate::Build(ISearchPath& searchPath, const std::filesystem::path& ou
auto functions = FileToZlibWrapper::CreateFunctions32ForFile(&file); auto functions = FileToZlibWrapper::CreateFunctions32ForFile(&file);
auto zipFile = zipOpen2(filePath.c_str(), APPEND_STATUS_CREATE, nullptr, &functions); auto zipFile = zipOpen2(filePath.string().c_str(), APPEND_STATUS_CREATE, nullptr, &functions);
if (!zipFile) if (!zipFile)
{ {
std::cerr << std::format("Failed to open file as zip for iwd {}\n", m_name); std::cerr << std::format("Failed to open file as zip for iwd {}\n", m_name);
@ -68,7 +68,7 @@ void IwdToCreate::Build(ISearchPath& searchPath, const std::filesystem::path& ou
readFile.m_stream->read(tempBuffer, sizeof(tempBuffer)); readFile.m_stream->read(tempBuffer, sizeof(tempBuffer));
const auto readCount = readFile.m_stream->gcount(); const auto readCount = readFile.m_stream->gcount();
if (readCount > 0) if (readCount > 0)
zipWriteInFileInZip(zipFile, tempBuffer, readCount); zipWriteInFileInZip(zipFile, tempBuffer, static_cast<unsigned>(readCount));
} while (!readFile.m_stream->eof()); } while (!readFile.m_stream->eof());
zipCloseFileInZip(zipFile); zipCloseFileInZip(zipFile);