1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

use 32-bit minizip file funcs on old Android

This commit is contained in:
Andrey Filipenkov
2024-02-06 01:29:13 +03:00
parent d321a01e1b
commit 5a58edde22
4 changed files with 35 additions and 7 deletions

View File

@@ -181,12 +181,17 @@ std::vector<std::string> ZipArchive::listFiles()
ZipArchive::ZipArchive(const boost::filesystem::path & from)
{
CDefaultIOApi zipAPI;
auto zipStructure = zipAPI.getApiStructure();
#if MINIZIP_NEEDS_32BIT_FUNCS
auto zipStructure = zipAPI.getApiStructure32();
archive = unzOpen2(from.c_str(), &zipStructure);
#else
auto zipStructure = zipAPI.getApiStructure();
archive = unzOpen2_64(from.c_str(), &zipStructure);
#endif
if (archive == nullptr)
throw std::runtime_error("Failed to open file" + from.string() + "'%s'! Unable to list files!");
throw std::runtime_error("Failed to open file '" + from.string() + "' - unable to list files!");
}
ZipArchive::~ZipArchive()