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
This commit is contained in:
Rafael Espindola
2014-06-13 17:20:48 +00:00
parent 33fe993f2e
commit d8b23109b2
16 changed files with 134 additions and 38 deletions

View File

@@ -12,12 +12,12 @@
// errors to generic ones. The one implemented in msvc is too conservative
// for llvm, so we do an extra mapping when constructing an error_code
// from an windows error. This allows the rest of llvm to simple checks
// like "EC == std::errc::file_exists" and have it work on both posix and
// like "EC == errc::file_exists" and have it work on both posix and
// windows.
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/Errc.h"
#include "llvm/Support/WindowsError.h"
#include "llvm/Config/llvm-config.h"
@@ -30,7 +30,7 @@
// I'd rather not double the line count of the following.
#define MAP_ERR_TO_COND(x, y) \
case x: \
return std::make_error_code(std::errc::y)
return make_error_code(errc::y)
std::error_code llvm::mapWindowsError(unsigned EV) {
switch (EV) {