From 5024ada1786143f4946a574f4f0bbe3da7b93520 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Sun, 12 Aug 2012 13:57:35 -0700 Subject: move Win32Fatal into util --- src/subprocess-win32.cc | 8 -------- src/util.cc | 4 ++++ 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) { 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_ -- cgit v0.12