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 | d8b23109b26f2070e21d5515ed2472ca9ab0111c (patch) | |
tree | ee7abbcf41f5cecd956761c5bcc135a53c6f10ab /lib/Support/Unix | |
parent | 33fe993f2ec3a146e5954db14aa9a751141677f0 (diff) | |
download | llvm-d8b23109b26f2070e21d5515ed2472ca9ab0111c.tar.gz llvm-d8b23109b26f2070e21d5515ed2472ca9ab0111c.tar.bz2 llvm-d8b23109b26f2070e21d5515ed2472ca9ab0111c.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r-- | lib/Support/Unix/Path.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index 824673649c..c9fae42986 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -317,7 +317,7 @@ std::error_code remove(const Twine &path, bool IgnoreNonExisting) { // effectively prevents LLVM from erasing things like /dev/null, any block // special file, or other things that aren't "regular" files. if (!S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode) && !S_ISLNK(buf.st_mode)) - return make_error_code(std::errc::operation_not_permitted); + return make_error_code(errc::operation_not_permitted); if (::remove(p.begin()) == -1) { if (errno != ENOENT || !IgnoreNonExisting) @@ -404,7 +404,7 @@ static std::error_code fillStatus(int StatRet, const struct stat &Status, file_status &Result) { if (StatRet != 0) { std::error_code ec(errno, std::generic_category()); - if (ec == std::errc::no_such_file_or_directory) + if (ec == errc::no_such_file_or_directory) Result = file_status(file_type::file_not_found); else Result = file_status(file_type::status_error); @@ -468,7 +468,7 @@ std::error_code setLastModificationAndAccessTime(int FD, TimeValue Time) { return std::error_code(); #else #warning Missing futimes() and futimens() - return make_error_code(std::errc::not_supported); + return make_error_code(errc::not_supported); #endif } @@ -512,7 +512,7 @@ mapped_file_region::mapped_file_region(const Twine &path, , Mapping() { // Make sure that the requested size fits within SIZE_T. if (length > std::numeric_limits<size_t>::max()) { - ec = make_error_code(std::errc::invalid_argument); + ec = make_error_code(errc::invalid_argument); return; } @@ -541,7 +541,7 @@ mapped_file_region::mapped_file_region(int fd, , Mapping() { // Make sure that the requested size fits within SIZE_T. if (length > std::numeric_limits<size_t>::max()) { - ec = make_error_code(std::errc::invalid_argument); + ec = make_error_code(errc::invalid_argument); return; } |