summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-08-12 20:57:35 (GMT)
committerEvan Martin <martine@danga.com>2012-08-12 20:57:35 (GMT)
commit5024ada1786143f4946a574f4f0bbe3da7b93520 (patch)
tree89033ca758927bd2275edc0da1737596db9e79a7 /src
parent5cc5615211b1cf83605a0fb7565cc640f4d7698e (diff)
downloadNinja-5024ada1786143f4946a574f4f0bbe3da7b93520.zip
Ninja-5024ada1786143f4946a574f4f0bbe3da7b93520.tar.gz
Ninja-5024ada1786143f4946a574f4f0bbe3da7b93520.tar.bz2
move Win32Fatal into util
Diffstat (limited to 'src')
-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_