瀏覽代碼

Set _fmode = O_BINARY at startup; relying upon fmode.o doesn't work
for libraries loaded at run-time (e.g. ctypes).



git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43279 15284696-431f-4ddb-bdfa-cd5b030d7da7

Glynn Clements 14 年之前
父節點
當前提交
75d57fff63
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      lib/gis/gisinit.c

+ 5 - 1
lib/gis/gisinit.c

@@ -15,9 +15,10 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <locale.h>
 
@@ -112,6 +113,9 @@ void G__check_gisinit(void)
 
 static int gisinit(void)
 {
+#ifdef __MINGW32__
+    _fmode = O_BINARY;
+#endif
     /* Mark window as not set */
     G__.window_set = 0;