#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/system_error.h"
#include "llvm/Support/type_traits.h"
+#include "llvm/Support/WindowsError.h"
#include <algorithm>
#include <cerrno>
#include <cstdlib>
typedef ScopedHandle<FileHandle> FileScopedHandle;
}
-static error_code windows_error(unsigned E) {
- return error_code(E, system_category());
-}
+static error_code windows_error(DWORD E) { return mapWindowsError(E); }
static error_code GetFileNameFromHandle(HANDLE FileHandle,
std::string& Name) {
if (!success) {
ec = windows_error(::GetLastError());
- if (ec == errc::timed_out) {
+ if (ec == std::errc::timed_out) {
errs() << ToolName << ": Process timed out.\n";
::TerminateProcess(ProcessInfo.hProcess, -1);
// Otherwise other stuff starts failing...