MinGW fixes.

This commit is contained in:
ehofman 2006-01-04 09:08:35 +00:00
parent b7115659b3
commit 1df002de81

View File

@ -30,7 +30,7 @@
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef _MSC_VER #if defined( _MSC_VER) || defined(__MINGW32__)
# include <direct.h> # include <direct.h>
#endif #endif
#include "sg_path.hxx" #include "sg_path.hxx"
@ -187,7 +187,7 @@ bool SGPath::exists() const {
return true; return true;
} }
#ifdef _MSC_VER #if defined( _MSC_VER) || defined(__MINGW32__)
# define sgMkDir(d,m) _mkdir(d) # define sgMkDir(d,m) _mkdir(d)
#else #else
# define sgMkDir(d,m) mkdir(d,m) # define sgMkDir(d,m) mkdir(d,m)
@ -203,7 +203,7 @@ void SGPath::create_dir( mode_t mode ) {
int i = 1; int i = 1;
SGPath dir = absolute ? string( 1, sgDirPathSep ) : ""; SGPath dir = absolute ? string( 1, sgDirPathSep ) : "";
dir.concat( path_elements[0] ); dir.concat( path_elements[0] );
#ifdef _MSC_VER #if defined( _MSC_VER) || defined(__MINGW32__)
if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) { if ( dir.str().find(':') != string::npos && path_elements.size() >= 2 ) {
dir.append( path_elements[1] ); dir.append( path_elements[1] );
i = 2; i = 2;