diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-11 03:58:34 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-11 03:58:34 +0000 |
commit | e5e77d1cd85037d91116a6483ce74fe99b483341 (patch) | |
tree | bc169c2bc99d3ee7368f2aea502d28ce7babac92 /utils | |
parent | 7456ad12403c8bf4bb30cd00ba2d26ad5af19c46 (diff) | |
download | llvm-e5e77d1cd85037d91116a6483ce74fe99b483341.tar.gz llvm-e5e77d1cd85037d91116a6483ce74fe99b483341.tar.bz2 llvm-e5e77d1cd85037d91116a6483ce74fe99b483341.tar.xz |
Remove windows_error.
MSVC doesn't seem to provide any is_error_code_enum enumeration for the
windows errors.
Fortunately very few places in llvm have to handle raw windows errors, so
we can just construct the corresponding error_code directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/KillTheDoctor/KillTheDoctor.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/KillTheDoctor/KillTheDoctor.cpp b/utils/KillTheDoctor/KillTheDoctor.cpp index a0d314bf10..f236c5ffc9 100644 --- a/utils/KillTheDoctor/KillTheDoctor.cpp +++ b/utils/KillTheDoctor/KillTheDoctor.cpp @@ -169,6 +169,10 @@ namespace { typedef ScopedHandle<FileHandle> FileScopedHandle; } +static error_code windows_error(unsigned E) { + return error_code(E, system_category()); +} + static error_code GetFileNameFromHandle(HANDLE FileHandle, std::string& Name) { char Filename[MAX_PATH+1]; @@ -245,7 +249,7 @@ static std::string FindProgram(const std::string &Program, error_code &ec) { ec = windows_error(::GetLastError()); else if (length > array_lengthof(PathName)) { // This may have been the file, return with error. - ec = windows_error::buffer_overflow; + ec = windows_error(ERROR_BUFFER_OVERFLOW); break; } else { // We found the path! Return it. |