Implement get_magic with generic tools and inline it.
[oota-llvm.git] / lib / Support / Windows / Process.inc
index 006bd8008447ef2525fe1f29299bb1ba09dd920b..0be871c695c0a72a838a7c9ca6e82c4d76ca53fd 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/WindowsError.h"
 #include <malloc.h>
 
 // The Windows.h header must be after LLVM and standard headers.
@@ -179,6 +180,10 @@ Optional<std::string> Process::GetEnv(StringRef Name) {
   return std::string(Res.data());
 }
 
+static error_code windows_error(DWORD E) {
+  return mapWindowsError(E);
+}
+
 error_code
 Process::GetArgumentVector(SmallVectorImpl<const char *> &Args,
                            ArrayRef<const char *>,