[Bf-blender-cvs] [a6775efb4f2] master: Alembic exporter: Fix Windows build errors

Sybren A. Stüvel noreply at git.blender.org
Tue Jun 30 13:13:27 CEST 2020


Commit: a6775efb4f26531c299b805915f5865b06fad75b
Author: Sybren A. Stüvel
Date:   Tue Jun 30 13:09:40 2020 +0200
Branches: master
https://developer.blender.org/rBa6775efb4f26531c299b805915f5865b06fad75b

Alembic exporter: Fix Windows build errors

Some Windows-specific code needed adjustment after 2917df21adc8a1ce.

===================================================================

M	source/blender/io/alembic/exporter/abc_archive.cc

===================================================================

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



More information about the Bf-blender-cvs mailing list