From 22c591a4069a6007441da4f3ab7a3dfda37cc36e Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 9 Aug 2017 11:42:31 +0200 Subject: [PATCH] Fix build against older libzip --- src/plugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugin.cpp b/src/plugin.cpp index f9eb09c5..228fcac8 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -23,6 +23,12 @@ #include "plugin.hpp" +#if LIBZIP_VERSION_MAJOR == 0 && LIBZIP_VERSION_MINOR <= 10 +typedef zip zip_t; +typedef zip_file zip_file_t; +typedef struct zip_stat zip_stat_t; +#endif + namespace rack { @@ -167,7 +173,7 @@ static void extract_zip(const char *dir, int zipfd) { if (!za) return; if (err) goto cleanup; - for (int i = 0; i < zip_get_num_entries(za, 0); i++) { + for (zip_uint64_t i = 0; i < zip_get_num_entries(za, 0); i++) { zip_stat_t zs; err = zip_stat_index(za, i, 0, &zs); if (err) goto cleanup;