From a6775efb4f26531c299b805915f5865b06fad75b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 30 Jun 2020 13:09:40 +0200 Subject: Alembic exporter: Fix Windows build errors Some Windows-specific code needed adjustment after 2917df21adc8a1ce. --- source/blender/io/alembic/exporter/abc_archive.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/blender/io/alembic/exporter/abc_archive.cc b/source/blender/io/alembic/exporter/abc_archive.cc index dbf046e6dfe..5fbf74f0705 100644 --- a/source/blender/io/alembic/exporter/abc_archive.cc +++ b/source/blender/io/alembic/exporter/abc_archive.cc @@ -30,6 +30,13 @@ #include #include +#ifdef WIN32 +# include "BLI_path_util.h" +# include "BLI_string.h" + +# include "utfconv.h" +#endif + namespace blender { namespace io { namespace alembic { @@ -81,10 +88,13 @@ static OArchive *create_archive(std::ofstream *abc_ostream, { /* Use stream to support unicode character paths on Windows. */ #ifdef WIN32 - UTF16_ENCODE(filename); - std::wstring wstr(filename_16); + char filename_cstr[FILE_MAX]; + BLI_strncpy(filename_cstr, filename.c_str(), FILE_MAX); + + UTF16_ENCODE(filename_cstr); + std::wstring wstr(filename_cstr_16); abc_ostream->open(wstr.c_str(), std::ios::out | std::ios::binary); - UTF16_UN_ENCODE(filename); + UTF16_UN_ENCODE(filename_cstr); #else abc_ostream->open(filename, std::ios::out | std::ios::binary); #endif -- cgit v1.2.3