summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-08-31 17:35:29 +0800
committerJohn Hodge <tpg@mutabah.net>2017-08-31 17:35:29 +0800
commit43a9adaef989a8bed5f8fafeef78555df0bd8fb0 (patch)
tree6eedfe5af1e1a4a3fd0ae18cf6cb94713cfbb260 /tools
parentbb4c5f2b93b4188f8cf574a782303bc05756b230 (diff)
downloadmrust-43a9adaef989a8bed5f8fafeef78555df0bd8fb0.tar.gz
Misc - Windows compile fixes
Diffstat (limited to 'tools')
-rw-r--r--tools/minicargo/build.cpp3
-rw-r--r--tools/minicargo/path.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/tools/minicargo/build.cpp b/tools/minicargo/build.cpp
index 56f9b076..b805ebb5 100644
--- a/tools/minicargo/build.cpp
+++ b/tools/minicargo/build.cpp
@@ -1,5 +1,8 @@
/*
*/
+#ifdef _WIN32
+# define _CRT_SECURE_NO_WARNINGS // Allows use of getenv (this program doesn't set env vars)
+#endif
#include "manifest.h"
#include "build.h"
#include "debug.h"
diff --git a/tools/minicargo/path.cpp b/tools/minicargo/path.cpp
index 93281e0f..12e505bb 100644
--- a/tools/minicargo/path.cpp
+++ b/tools/minicargo/path.cpp
@@ -2,6 +2,7 @@
*/
#include "path.h"
#if _WIN32
+# include <Windows.h>
#else
# include <unistd.h> // getcwd/chdir
#endif
@@ -41,6 +42,8 @@ helpers::path helpers::path::to_absolute() const
return *this;
#if _WIN32
+ char cwd[1024];
+ GetCurrentDirectoryA(sizeof(cwd), cwd);
#else
char cwd[1024];
if( !getcwd(cwd, sizeof(cwd)) )