mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 03:25:54 -04:00
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
d8016b0e78
commit
799c27e8ad
@ -236,7 +236,7 @@ bool CrashRecoveryContext::RunSafely(function_ref<void()> Fn) {
|
|||||||
// XP, so if support for older versions of Windows is required,
|
// XP, so if support for older versions of Windows is required,
|
||||||
// it will have to be added.
|
// it will have to be added.
|
||||||
|
|
||||||
#include "Windows/WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
|
|
||||||
static LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo)
|
static LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo)
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "Windows/WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "Windows/WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#else
|
#else
|
||||||
#include "Unix/Unix.h"
|
#include "Unix/Unix.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#include "llvm/Support/ConvertUTF.h"
|
#include "llvm/Support/ConvertUTF.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "llvm/Support/WindowsError.h"
|
#include "llvm/Support/WindowsError.h"
|
||||||
|
|
||||||
// The Windows.h header must be the last one included.
|
// The Windows.h header must be the last one included.
|
||||||
#include "WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
|
|
||||||
static DWORD getWindowsProtectionFlags(unsigned Flags) {
|
static DWORD getWindowsProtectionFlags(unsigned Flags) {
|
||||||
switch (Flags & llvm::sys::Memory::MF_RWE_MASK) {
|
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
|
// 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
|
// 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 <shellapi.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
// The Windows.h header must be after LLVM and standard headers.
|
// The Windows.h header must be after LLVM and standard headers.
|
||||||
#include "WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
|
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
#include "llvm/Support/ConvertUTF.h"
|
#include "llvm/Support/ConvertUTF.h"
|
||||||
#include "llvm/Support/Errc.h"
|
#include "llvm/Support/Errc.h"
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
|
||||||
// The Windows.h header must be after LLVM and standard headers.
|
// The Windows.h header must be after LLVM and standard headers.
|
||||||
#include "WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
#include <imagehlp.h>
|
#include <imagehlp.h>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
//=== is guaranteed to work on *all* Win32 variants.
|
//=== is guaranteed to work on *all* Win32 variants.
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#include "llvm/Support/ThreadLocal.h"
|
#include "llvm/Support/ThreadLocal.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "llvm/ADT/SmallString.h"
|
#include "llvm/ADT/SmallString.h"
|
||||||
#include "llvm/ADT/Twine.h"
|
#include "llvm/ADT/Twine.h"
|
||||||
|
|
||||||
#include "WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
|
||||||
// Windows will at times define MemoryFence.
|
// Windows will at times define MemoryFence.
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "llvm/Support/ConvertUTF.h"
|
#include "llvm/Support/ConvertUTF.h"
|
||||||
#include "Windows/WindowsSupport.h"
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
@ -45,8 +45,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#include "llvm/Support/Windows/WindowsSupport.h"
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
Loading…
Reference in New Issue
Block a user