From: ehofman <ehofman>
Date: Sat, 17 Dec 2005 15:32:43 +0000 (+0000)
Subject: MSVC fixes.
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0911fa4fa2d418fbbbaf8cf9891609aee87b411d;p=simgear.git

MSVC fixes.
---

diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx
index dd0b7068..056a84db 100644
--- a/simgear/misc/sg_path.cxx
+++ b/simgear/misc/sg_path.cxx
@@ -30,7 +30,9 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
-
+#ifdef _MSC_VER
+#  include <direct.h>
+#endif
 #include "sg_path.hxx"
 
 
@@ -195,7 +197,11 @@ void SGPath::create_dir( mode_t mode ) {
     }
     for(;i < dirlist.size(); i++) {
         string subdir = dirlist[i];
+#ifdef _MSC_VER
+        if ( _mkdir( subdir.c_str()) ) {
+#else
         if ( mkdir( subdir.c_str(), mode) ) {
+#endif
             SG_LOG( SG_IO, SG_ALERT, "Error creating directory: " + dir.str() );
             break;
         }
diff --git a/simgear/misc/sg_path.hxx b/simgear/misc/sg_path.hxx
index 2921ac27..f843061b 100644
--- a/simgear/misc/sg_path.hxx
+++ b/simgear/misc/sg_path.hxx
@@ -38,6 +38,9 @@
 
 SG_USING_STD(string);
 
+#ifdef _MSC_VER
+  typedef int mode_t;
+#endif
 
 /**
  * A class to hide path separator difference across platforms and assist