From 73fdb8b125e6090085a0e69f7c7d3279784b30c0 Mon Sep 17 00:00:00 2001 From: Lethosor Date: Thu, 19 Jun 2014 21:24:16 -0400 Subject: [PATCH 1/2] Fix Windows compile-time error --- library/modules/Filesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/modules/Filesystem.cpp b/library/modules/Filesystem.cpp index 9f0df3097..2c3cf5dfe 100644 --- a/library/modules/Filesystem.cpp +++ b/library/modules/Filesystem.cpp @@ -88,7 +88,7 @@ bool DFHack::Filesystem::rmdir (std::string path) } #ifdef _WIN32 -_filetype *mode2type (unsigned short mode) { +_filetype mode2type (unsigned short mode) { #else _filetype mode2type (mode_t mode) { #endif From ec64a787c6ced5e0257b94ae143a54f590be46d1 Mon Sep 17 00:00:00 2001 From: Lethosor Date: Thu, 19 Jun 2014 22:34:40 -0400 Subject: [PATCH 2/2] Use _getcwd on Windows --- library/modules/Filesystem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/modules/Filesystem.cpp b/library/modules/Filesystem.cpp index 2c3cf5dfe..35a48930f 100644 --- a/library/modules/Filesystem.cpp +++ b/library/modules/Filesystem.cpp @@ -58,7 +58,11 @@ char * DFHack::Filesystem::getcwd () { char *path; char buf[LFS_MAXPATHLEN]; +#ifdef _WIN32 + if ((path = ::_getcwd(buf, LFS_MAXPATHLEN)) == NULL) +#else if ((path = ::getcwd(buf, LFS_MAXPATHLEN)) == NULL) +#endif return NULL; else return path;