From 0911fa4fa2d418fbbbaf8cf9891609aee87b411d Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 17 Dec 2005 15:32:43 +0000 Subject: [PATCH] MSVC fixes. --- simgear/misc/sg_path.cxx | 8 +++++++- simgear/misc/sg_path.hxx | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) 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 #include #include - +#ifdef _MSC_VER +# include +#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 -- 2.39.5