Index: util/test/errors.cc |
diff --git a/util/test/errors.cc b/util/test/errors.cc |
index 1fd3a0f515084ad43dae2c377d948f88094bd61a..757062c5224280744aa1fc721e5332fe75b7ce5c 100644 |
--- a/util/test/errors.cc |
+++ b/util/test/errors.cc |
@@ -16,13 +16,15 @@ |
#include <errno.h> |
-#include "build/build_config.h" |
+#include "base/logging.h" |
#include "base/strings/stringprintf.h" |
+#include "build/build_config.h" |
#if defined(OS_POSIX) |
#include "base/safe_strerror_posix.h" |
#elif defined(OS_WIN) |
#include <string.h> |
+#include <windows.h> |
#endif |
namespace crashpad { |
@@ -47,5 +49,15 @@ std::string ErrnoMessage(const std::string& base) { |
return ErrnoMessage(errno, base); |
} |
+#if defined(OS_WIN) |
+std::string ErrorMessage(const std::string& base) { |
+ return base::StringPrintf( |
+ "%s%s%s", |
+ base.c_str(), |
+ base.empty() ? "" : ": ", |
+ logging::SystemErrorCodeToString(GetLastError()).c_str()); |
+} |
+#endif |
+ |
} // namespace test |
} // namespace crashpad |