diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-06-30 14:09:40 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-06-30 14:09:44 +0300 |
commit | a6775efb4f26531c299b805915f5865b06fad75b (patch) | |
tree | c99eaa553dad42f2030b582fae14dfc607a893ea /source/blender/io/alembic/exporter | |
parent | b838a518031b9fa83826933ce8e7f0a31d8d9b9d (diff) |
Alembic exporter: Fix Windows build errors
Some Windows-specific code needed adjustment after 2917df21adc8a1ce.
Diffstat (limited to 'source/blender/io/alembic/exporter')
-rw-r--r-- | source/blender/io/alembic/exporter/abc_archive.cc | 16 |
1 files changed, 13 insertions, 3 deletions
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 <Alembic/AbcCoreOgawa/All.h> #include <Alembic/AbcGeom/All.h> +#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 |