From 916016f2d4bf2e183e45ebddc85e708e1eadc821 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Sun, 2 Jun 2019 19:10:13 +0200 Subject: [PATCH] Use nowide fopen in Zipper instead of patching miniz. --- src/libslic3r/Zipper.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libslic3r/Zipper.cpp b/src/libslic3r/Zipper.cpp index e9c0bb4ed..afeaa8eca 100644 --- a/src/libslic3r/Zipper.cpp +++ b/src/libslic3r/Zipper.cpp @@ -1,11 +1,9 @@ #include -#include -#include #include "Zipper.hpp" #include #include - +#include #include "I18N.hpp" //! macro used to mark string used at localization, @@ -126,8 +124,15 @@ Zipper::Zipper(const std::string &zipfname, e_compression compression) memset(&m_impl->arch, 0, sizeof(m_impl->arch)); + FILE *f = boost::nowide::fopen(zipfname.c_str(), "wb"); + + if (f == nullptr) { + m_impl->arch.m_last_error = MZ_ZIP_FILE_OPEN_FAILED; + m_impl->blow_up(); + } + // Initialize the archive data - if(!mz_zip_writer_init_file(&m_impl->arch, zipfname.c_str(), 0)) + if(!mz_zip_writer_init_cfile(&m_impl->arch, f, 0)) m_impl->blow_up(); }