Turn errc and windows_error into enum classes.

llvm-svn: 209957
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index 2925e64..fbd7ced 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -248,7 +248,7 @@
   while (true) {
     if (::getcwd(result.data(), result.capacity()) == nullptr) {
       // See if there was a real error.
-      if (errno != errc::not_enough_memory)
+      if (errno != ENOMEM)
         return error_code(errno, system_category());
       // Otherwise there just wasn't enough space.
       result.reserve(result.capacity() * 2);
@@ -265,7 +265,7 @@
   StringRef p = path.toNullTerminatedStringRef(path_storage);
 
   if (::mkdir(p.begin(), S_IRWXU | S_IRWXG) == -1) {
-    if (errno != errc::file_exists || !IgnoreExisting)
+    if (errno != EEXIST || !IgnoreExisting)
       return error_code(errno, system_category());
   }
 
@@ -306,7 +306,7 @@
 
   struct stat buf;
   if (lstat(p.begin(), &buf) != 0) {
-    if (errno != errc::no_such_file_or_directory || !IgnoreNonExisting)
+    if (errno != ENOENT || !IgnoreNonExisting)
       return error_code(errno, system_category());
     return error_code();
   }
@@ -320,7 +320,7 @@
     return make_error_code(errc::operation_not_permitted);
 
   if (::remove(p.begin()) == -1) {
-    if (errno != errc::no_such_file_or_directory || !IgnoreNonExisting)
+    if (errno != ENOENT || !IgnoreNonExisting)
       return error_code(errno, system_category());
   }
 
@@ -355,7 +355,7 @@
   StringRef p = path.toNullTerminatedStringRef(path_storage);
 
   if (::access(p.begin(), F_OK) == -1) {
-    if (errno != errc::no_such_file_or_directory)
+    if (errno != ENOENT)
       return error_code(errno, system_category());
     result = false;
   } else
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index 8baa263..f04900c 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -810,7 +810,7 @@
     if (EC != windows_error::access_denied)
       return EC;
     if (is_directory(Name))
-      return error_code(errc::is_a_directory, posix_category());
+      return make_error_code(errc::is_a_directory);
     return EC;
   }
 
@@ -861,7 +861,7 @@
     if (EC != windows_error::access_denied)
       return EC;
     if (is_directory(Name))
-      return error_code(errc::is_a_directory, posix_category());
+      return make_error_code(errc::is_a_directory);
     return EC;
   }