diff options
author | Evan Martin <martine@danga.com> | 2012-08-12 20:57:35 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-08-12 20:57:35 (GMT) |
commit | 5024ada1786143f4946a574f4f0bbe3da7b93520 (patch) | |
tree | 89033ca758927bd2275edc0da1737596db9e79a7 | |
parent | 5cc5615211b1cf83605a0fb7565cc640f4d7698e (diff) | |
download | Ninja-5024ada1786143f4946a574f4f0bbe3da7b93520.zip Ninja-5024ada1786143f4946a574f4f0bbe3da7b93520.tar.gz Ninja-5024ada1786143f4946a574f4f0bbe3da7b93520.tar.bz2 |
move Win32Fatal into util
-rw-r--r-- | src/subprocess-win32.cc | 8 | ||||
-rw-r--r-- | src/util.cc | 4 | ||||
-rw-r--r-- | src/util.h | 3 |
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) { @@ -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_ |