Fix Centos 7 build.
[dcpomatic.git] / src / lib / zipper.cc
index db84cdf71db596062a68b6ad5a8ec06382fd337c..625f3049a52a76df41c13d5bd94a49cfa6f6f3af 100644 (file)
@@ -57,7 +57,11 @@ Zipper::add (string name, string content)
                throw runtime_error ("could not create ZIP source");
        }
 
+#ifdef DCPOMATIC_HAVE_ZIP_FILE_ADD
        if (zip_file_add(_zip, name.c_str(), source, ZIP_FL_ENC_GUESS) == -1) {
+#else
+       if (zip_add(_zip, name.c_str(), source) == -1) {
+#endif
                throw runtime_error(String::compose("failed to add data to ZIP archive (%1)", zip_strerror(_zip)));
        }
 }