Hopefully fix a mingw32 buildbot (i686-mingw32-RA-on-linux) which does not have
[oota-llvm.git] / lib / Support / Windows / WindowsSupport.h
index 5e5163b3493254e7b198aa65a1690d5a9cd36006..2e75d1674a3d2e41528653c610e7a887110d90f3 100644 (file)
@@ -31,7 +31,9 @@
 #define _WIN32_IE    0x0800 // MinGW at it again. FIXME: verify if still needed.
 #define WIN32_LEAN_AND_MEAN
 #define NOGDI
+#ifndef NOMINMAX
 #define NOMINMAX
+#endif
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include <string>
 #include <vector>
 
-#ifndef __CYGWIN__
+#if !defined(__CYGWIN__) && \
+    !(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR))
 #include <VersionHelpers.h>
 #else
 // Cygwin does not have the IsWindows8OrGreater() API.
+// Mingw32 does not have the API either (but mingw-w64 does).
 inline bool IsWindows8OrGreater() {
   OSVERSIONINFO osvi = {};
   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);