[Bf-blender-cvs] [0d5aa352d37] master: Fix broken Windows buiilds after own recent commit in read/write code.

Bastien Montagne noreply at git.blender.org
Sun Sep 20 19:35:55 CEST 2020


Commit: 0d5aa352d37dc496a07b88d993939c49bcbe8b1d
Author: Bastien Montagne
Date:   Sun Sep 20 19:34:12 2020 +0200
Branches: master
https://developer.blender.org/rB0d5aa352d37dc496a07b88d993939c49bcbe8b1d

Fix broken Windows buiilds after own recent commit in read/write code.

Usual issue of win32 not following POSIX standards.

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

M	source/blender/blenloader/intern/readfile.h
M	source/blender/blenloader/intern/undofile.c

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

diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index c479e3e589b..d43f7ded50e 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -24,6 +24,10 @@
 
 #pragma once
 
+#ifdef WIN32
+#  include "BLI_winstuff.h"
+#endif
+
 #include "DNA_sdna_types.h"
 #include "DNA_space_types.h"
 #include "DNA_windowmanager_types.h" /* for ReportType */
diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c
index 4da73138c38..92aec13ecf1 100644
--- a/source/blender/blenloader/intern/undofile.c
+++ b/source/blender/blenloader/intern/undofile.c
@@ -252,7 +252,11 @@ bool BLO_memfile_write_file(struct MemFile *memfile, const char *filename)
   }
 
   for (chunk = memfile->chunks.first; chunk; chunk = chunk->next) {
+#ifdef _WIN32
+    if ((size_t)write(file, chunk->buf, (uint)chunk->size) != chunk->size) {
+#else
     if ((size_t)write(file, chunk->buf, chunk->size) != chunk->size) {
+#endif
       break;
     }
   }



More information about the Bf-blender-cvs mailing list