diff options
| -rw-r--r-- | src/lib/unzipper.cc | 4 | ||||
| -rw-r--r-- | wscript | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/unzipper.cc b/src/lib/unzipper.cc index 2add8f2a9..f0170e7e0 100644 --- a/src/lib/unzipper.cc +++ b/src/lib/unzipper.cc @@ -39,7 +39,11 @@ using std::string; Unzipper::Unzipper(boost::filesystem::path file) { int error; +#ifdef DCPOMATIC_HAVE_ZIP_RDONLY _zip = zip_open(dcp::filesystem::fix_long_path(file).string().c_str(), ZIP_RDONLY, &error); +#else + _zip = zip_open(dcp::filesystem::fix_long_path(file).string().c_str(), 0, &error); +#endif if (!_zip) { throw FileError("could not open ZIP file", file); } @@ -281,6 +281,15 @@ def configure(conf): uselib="ZIP", define_name='DCPOMATIC_HAVE_ZIP_FILE_ADD' ) + conf.check_cxx(fragment=""" + #include <zip.h> + int main() { int error; zip_open("foo", ZIP_RDONLY, &error); } + """, + mandatory=False, + msg="Checking for ZIP_RDONLY", + uselib="ZIP", + define_name='DCPOMATIC_HAVE_ZIP_RDONLY' + ) # libbz2; must be explicitly linked on macOS for some reason conf.check_cxx(fragment=""" |
