diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-13 17:20:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-13 17:20:48 +0000 |
commit | 2a826e40fa51fcae4adb564d789cafe95776e0bb (patch) | |
tree | fc0dea973c66e8777a6354c1e01199057d38b023 /llvm/lib/Support/Windows/Path.inc | |
parent | 372bc70c639a45e69a519a2e47f0b9a06e23914a (diff) | |
download | bcm5719-llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.tar.gz bcm5719-llvm-2a826e40fa51fcae4adb564d789cafe95776e0bb.zip |
Finishing touch for the std::error_code transition.
While std::error_code itself seems to work OK in all platforms, there
are few annoying differences with regards to the std::errc enumeration.
This patch adds a simple llvm enumeration, which will hopefully avoid build
breakages in other platforms and surprises as we get more uses of
std::error_code.
llvm-svn: 210920
Diffstat (limited to 'llvm/lib/Support/Windows/Path.inc')
-rw-r--r-- | llvm/lib/Support/Windows/Path.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc index 72f21ae5e68..7a1bc0447fa 100644 --- a/llvm/lib/Support/Windows/Path.inc +++ b/llvm/lib/Support/Windows/Path.inc @@ -196,7 +196,7 @@ std::error_code remove(const Twine &path, bool IgnoreNonExisting) { file_status ST; if (std::error_code EC = status(path, ST)) { - if (EC != std::errc::no_such_file_or_directory || !IgnoreNonExisting) + if (EC != errc::no_such_file_or_directory || !IgnoreNonExisting) return EC; return std::error_code(); } @@ -208,14 +208,14 @@ std::error_code remove(const Twine &path, bool IgnoreNonExisting) { if (ST.type() == file_type::directory_file) { if (!::RemoveDirectoryW(c_str(path_utf16))) { std::error_code EC = windows_error(::GetLastError()); - if (EC != std::errc::no_such_file_or_directory || !IgnoreNonExisting) + if (EC != errc::no_such_file_or_directory || !IgnoreNonExisting) return EC; } return std::error_code(); } if (!::DeleteFileW(c_str(path_utf16))) { std::error_code EC = windows_error(::GetLastError()); - if (EC != std::errc::no_such_file_or_directory || !IgnoreNonExisting) + if (EC != errc::no_such_file_or_directory || !IgnoreNonExisting) return EC; } return std::error_code(); @@ -481,7 +481,7 @@ std::error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) _close(FileDescriptor); } else ::CloseHandle(FileHandle); - return std::make_error_code(std::errc::invalid_argument); + return make_error_code(errc::invalid_argument); } DWORD flprotect; @@ -617,7 +617,7 @@ mapped_file_region::mapped_file_region(int fd, if (closefd) _close(FileDescriptor); FileDescriptor = 0; - ec = std::make_error_code(std::errc::bad_file_descriptor); + ec = make_error_code(errc::bad_file_descriptor); return; } @@ -779,7 +779,7 @@ std::error_code openFileForRead(const Twine &Name, int &ResultFD) { if (LastError != ERROR_ACCESS_DENIED) return EC; if (is_directory(Name)) - return std::make_error_code(std::errc::is_a_directory); + return make_error_code(errc::is_a_directory); return EC; } @@ -831,7 +831,7 @@ std::error_code openFileForWrite(const Twine &Name, int &ResultFD, if (LastError != ERROR_ACCESS_DENIED) return EC; if (is_directory(Name)) - return std::make_error_code(std::errc::is_a_directory); + return make_error_code(errc::is_a_directory); return EC; } |