From 84a53f91e64ad801703bcf2c73a82b75ff10d760 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 18 Sep 2008 17:35:58 +0000 Subject: fix win32 build and directory creation, use My Games\ --- src/sys/sys.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/sys') diff --git a/src/sys/sys.cc b/src/sys/sys.cc index 3aec456..db2be4d 100644 --- a/src/sys/sys.cc +++ b/src/sys/sys.cc @@ -10,6 +10,7 @@ #include #include #include +#include #else @@ -22,6 +23,7 @@ #endif +#include #include #include @@ -62,12 +64,15 @@ bool isdirectory(std::string const &path) void mkdir(std::string const &path) { #ifdef _WIN32 -/* std::string p(path); for (size_t i = 0; i < p.size(); i++) if (p[i] == '/') p[i] = '\\'; - mkdir(p.c_str()); -*/ + if (p.size() && (p[p.size()-1] == '\\')) + p.erase(p.size() -1, 1); + + if (_mkdir(p.c_str()) != 0) { + con_warn << "Could not create directory '" << p << "'" << std::endl; + } #else ::mkdir(path.c_str(), 0777); -- cgit v1.2.3