Trying to fix the windows build.
[oota-llvm.git] / lib / Support / Windows / Signals.inc
index 2b4a66d00896f636ec0e6bcd0a1b9d70208c229a..35ba6f8e1bba7542cf4c558c79bafab4b5a34dcb 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/FileSystem.h"
-
-#include "Windows.h"
 #include <algorithm>
 #include <stdio.h>
 #include <vector>
 
+// The Windows.h header must be after LLVM and standard headers.
+#include "WindowsSupport.h"
+
 #ifdef __MINGW32__
  #include <imagehlp.h>
 #else
@@ -135,7 +136,7 @@ typedef PVOID (WINAPI *fpSymFunctionTableAccess64)(HANDLE, DWORD64);
 static fpSymFunctionTableAccess64 SymFunctionTableAccess64;
 
 static bool load64BitDebugHelp(void) {
-  HMODULE hLib = ::LoadLibrary(TEXT("Dbghelp.dll"));
+  HMODULE hLib = ::LoadLibraryW(L"Dbghelp.dll");
   if (hLib) {
     StackWalk64 = (fpStackWalk64)
                       ::GetProcAddress(hLib, "StackWalk64");
@@ -317,8 +318,7 @@ static void Cleanup() {
 
   if (FilesToRemove != NULL)
     while (!FilesToRemove->empty()) {
-      bool Existed;
-      llvm::sys::fs::remove(FilesToRemove->back(), Existed);
+      llvm::sys::fs::remove(FilesToRemove->back());
       FilesToRemove->pop_back();
     }