diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-01-05 13:15:37 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-01-05 13:15:37 +0000 |
| commit | a34e100c7e8f7bce98cf074ecb0507fe6175df61 (patch) | |
| tree | 96a181b010964e7c7f89a3c14a010573d868612e /src | |
| parent | 22a1f899925b9bf0632563caf7da95fcba021ceb (diff) | |
Try to fix build on older Ubuntus etc.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/internet.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/internet.cc b/src/lib/internet.cc index 1e8c5d8e9..67f6ed2bc 100644 --- a/src/lib/internet.cc +++ b/src/lib/internet.cc @@ -79,6 +79,12 @@ get_from_zip_url (string url, string file, bool pasv, function<void (boost::file /* Open the ZIP file and read `file' out of it */ +#ifdef DCPOMATIC_HAVE_ZIP_SOURCE_T + /* This is the way to do it with newer versions of libzip, and is required on Windows. + The zip_source_t API is missing in the libzip versions shipped with Ubuntu 14.04, + Centos 6, Centos 7, Debian 7 and Debian 8. + */ + FILE* zip_file = fopen_boost (temp_zip.file (), "rb"); if (!zip_file) { return optional<string> (_("Could not open downloaded ZIP file")); @@ -94,6 +100,10 @@ get_from_zip_url (string url, string file, bool pasv, function<void (boost::file return optional<string> (_("Could not open downloaded ZIP file")); } +#else + struct zip* zip = zip_open (temp_zip.c_str(), 0, 0); +#endif + struct zip_file* file_in_zip = zip_fopen (zip, file.c_str(), 0); if (!file_in_zip) { return optional<string> (_("Unexpected ZIP file contents")); |
