Skip to content

Commit daae05a

Browse files
committed
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 (cherry picked from commit 01f9abb) This is for https://bugs.llvm.org/show_bug.cgi?id=44907
1 parent e705da0 commit daae05a

File tree

15 files changed

+14
-15
lines changed

15 files changed

+14
-15
lines changed

llvm/lib/Support/CrashRecoveryContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ bool CrashRecoveryContext::RunSafely(function_ref<void()> Fn) {
254254
// XP, so if support for older versions of Windows is required,
255255
// it will have to be added.
256256

257-
#include "Windows/WindowsSupport.h"
257+
#include "llvm/Support/Windows/WindowsSupport.h"
258258

259259
static LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo)
260260
{

llvm/lib/Support/InitLLVM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <string>
1616

1717
#ifdef _WIN32
18-
#include "Windows/WindowsSupport.h"
18+
#include "llvm/Support/Windows/WindowsSupport.h"
1919
#endif
2020

2121
using namespace llvm;

llvm/lib/Support/RandomNumberGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "llvm/Support/Debug.h"
1818
#include "llvm/Support/raw_ostream.h"
1919
#ifdef _WIN32
20-
#include "Windows/WindowsSupport.h"
20+
#include "llvm/Support/Windows/WindowsSupport.h"
2121
#else
2222
#include "Unix/Unix.h"
2323
#endif

llvm/lib/Support/Windows/DynamicLibrary.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "WindowsSupport.h"
13+
#include "llvm/Support/Windows/WindowsSupport.h"
1414
#include "llvm/Support/ConvertUTF.h"
1515
#include "llvm/Support/raw_ostream.h"
1616

llvm/lib/Support/Windows/Host.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "WindowsSupport.h"
13+
#include "llvm/Support/Windows/WindowsSupport.h"
1414
#include <cstdio>
1515
#include <string>
1616

llvm/lib/Support/Windows/Memory.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "llvm/Support/WindowsError.h"
1818

1919
// The Windows.h header must be the last one included.
20-
#include "WindowsSupport.h"
20+
#include "llvm/Support/Windows/WindowsSupport.h"
2121

2222
static DWORD getWindowsProtectionFlags(unsigned Flags) {
2323
switch (Flags & llvm::sys::Memory::MF_RWE_MASK) {

llvm/lib/Support/Windows/Path.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
// These two headers must be included last, and make sure shlobj is required
2727
// after Windows.h to make sure it picks up our definition of _WIN32_WINNT
28-
#include "WindowsSupport.h"
28+
#include "llvm/Support/Windows/WindowsSupport.h"
2929
#include <shellapi.h>
3030
#include <shlobj.h>
3131

llvm/lib/Support/Windows/Process.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <malloc.h>
2020

2121
// The Windows.h header must be after LLVM and standard headers.
22-
#include "WindowsSupport.h"
22+
#include "llvm/Support/Windows/WindowsSupport.h"
2323

2424
#include <direct.h>
2525
#include <io.h>

llvm/lib/Support/Windows/Program.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "WindowsSupport.h"
13+
#include "llvm/Support/Windows/WindowsSupport.h"
1414
#include "llvm/ADT/StringExtras.h"
1515
#include "llvm/Support/ConvertUTF.h"
1616
#include "llvm/Support/Errc.h"

0 commit comments

Comments
 (0)