Windows/DynamicLibrary.inc: ELM_Callback fix for mingw-w64.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 9 Feb 2011 04:18:12 +0000 (04:18 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 9 Feb 2011 04:18:12 +0000 (04:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125169 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Windows/DynamicLibrary.inc

index 5f44e63c781ce652a4139b214123cabb6f30202a..2c14366c0761d7a1a22d495d14141dedb7b59ef3 100644 (file)
@@ -55,7 +55,17 @@ extern "C" {
 // Use new callback if:
 //  - Newer Visual Studio (comes with newer SDK).
 //  - Visual Studio 2005 with Windows SDK 6.0+
-#if !defined(_MSC_VER) || _MSC_VER < 1500 && (!defined(VER_PRODUCTBUILD) || VER_PRODUCTBUILD < 6000)
+#if defined(_MSC_VER)
+  #if _MSC_VER < 1500 && (!defined(VER_PRODUCTBUILD) || VER_PRODUCTBUILD < 6000)
+    #define OLD_ELM_CALLBACK_DECL 1
+  #endif
+#elif defined(__MINGW64__)
+  // Use new callback.
+#elif defined(__MINGW32__)
+  #define OLD_ELM_CALLBACK_DECL 1
+#endif
+
+#ifdef OLD_ELM_CALLBACK_DECL
   static BOOL CALLBACK ELM_Callback(PSTR  ModuleName,
                                     ModuleBaseType ModuleBase,
                                     ULONG ModuleSize,