diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2019-06-02 20:10:13 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2019-06-02 20:10:13 +0300 |
commit | 916016f2d4bf2e183e45ebddc85e708e1eadc821 (patch) | |
tree | d5bc6d0d78d689dd968c5fc5e3919438d9ce01e9 /src | |
parent | f275cdafa96187691cfd7e1089722c983ad2a6ed (diff) |
Use nowide fopen in Zipper instead of patching miniz.
Diffstat (limited to 'src')
-rw-r--r-- | src/libslic3r/Zipper.cpp | 13 |
1 files 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 <exception> -#include <sstream> -#include <iostream> #include "Zipper.hpp" #include <miniz.h> #include <boost/log/trivial.hpp> - +#include <boost/nowide/cstdio.hpp> #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(); } |