summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/subprocess-win32.cc8
-rw-r--r--src/util.cc4
-rw-r--r--src/util.h3
3 files changed, 7 insertions, 8 deletions
diff --git a/src/subprocess-win32.cc b/src/subprocess-win32.cc
index 38b6957..4b103a5 100644
--- a/src/subprocess-win32.cc
+++ b/src/subprocess-win32.cc
@@ -20,14 +20,6 @@
#include "util.h"
-namespace {
-
-void Win32Fatal(const char* function) {
- Fatal("%s: %s", function, GetLastErrorString().c_str());
-}
-
-} // anonymous namespace
-
Subprocess::Subprocess() : child_(NULL) , overlapped_(), is_reading_(false) {
}
diff --git a/src/util.cc b/src/util.cc
index 90a1d45..14f6265 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -247,6 +247,10 @@ string GetLastErrorString() {
LocalFree(msg_buf);
return msg;
}
+
+void Win32Fatal(const char* function) {
+ Fatal("%s: %s", function, GetLastErrorString().c_str());
+}
#endif
static bool islatinalpha(int c) {
diff --git a/src/util.h b/src/util.h
index 7e30368..3a658fb 100644
--- a/src/util.h
+++ b/src/util.h
@@ -82,6 +82,9 @@ string ElideMiddle(const string& str, size_t width);
#ifdef _WIN32
/// Convert the value returned by GetLastError() into a string.
string GetLastErrorString();
+
+/// Calls Fatal() with a function name and GetLastErrorString.
+void Win32Fatal(const char* function);
#endif
#endif // NINJA_UTIL_H_