forked from OSchip/llvm-project
llvm-ar: Fix MinGW compilation
llvm-ar is using CompareStringOrdinal which is available only starting with Windows Vista (WINVER 0x600). Fix this by hoising WindowsSupport.h, which sets _WIN32_WINNT to 0x0601, up to llvm/include/llvm/Support and use it in llvm-ar. Patch by Cristian Adam! Differential revision: https://reviews.llvm.org/D74599
This commit is contained in:
parent
b17f292010
commit
01f9abbb50
|
@ -254,7 +254,7 @@ bool CrashRecoveryContext::RunSafely(function_ref<void()> Fn) {
|
|||
// XP, so if support for older versions of Windows is required,
|
||||
// it will have to be added.
|
||||
|
||||
#include "Windows/WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
|
||||
static LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <string>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "Windows/WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#ifdef _WIN32
|
||||
#include "Windows/WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#else
|
||||
#include "Unix/Unix.h"
|
||||
#endif
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#include "llvm/Support/ConvertUTF.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "llvm/Support/WindowsError.h"
|
||||
|
||||
// The Windows.h header must be the last one included.
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
|
||||
static DWORD getWindowsProtectionFlags(unsigned Flags) {
|
||||
switch (Flags & llvm::sys::Memory::MF_RWE_MASK) {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
// These two headers must be included last, and make sure shlobj is required
|
||||
// after Windows.h to make sure it picks up our definition of _WIN32_WINNT
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#include <shellapi.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <malloc.h>
|
||||
|
||||
// The Windows.h header must be after LLVM and standard headers.
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
|
||||
#include <direct.h>
|
||||
#include <io.h>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Support/ConvertUTF.h"
|
||||
#include "llvm/Support/Errc.h"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
// The Windows.h header must be after LLVM and standard headers.
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#include <imagehlp.h>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
//=== is guaranteed to work on *all* Win32 variants.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#include "llvm/Support/ThreadLocal.h"
|
||||
|
||||
namespace llvm {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
|
||||
#include "WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#include <process.h>
|
||||
|
||||
#include <bitset>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
#include "llvm/Support/ConvertUTF.h"
|
||||
#include "Windows/WindowsSupport.h"
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
|
|
|
@ -46,8 +46,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
|
|
Loading…
Reference in New Issue