[llvm-commits] [llvm] r70299 - /llvm/trunk/lib/System/Win32/DynamicLibrary.inc

Stefanus Du Toit stefanus.dutoit at rapidmind.com
Tue Apr 28 09:37:58 PDT 2009


Author: sdt
Date: Tue Apr 28 11:37:58 2009
New Revision: 70299

URL: http://llvm.org/viewvc/llvm-project?rev=70299&view=rev
Log:
Fix choice of version of Windows callback to use to consider not only the Visual Studio version, but also the Windows SDK version.

Patch by Tareq Siraj.

Modified:
    llvm/trunk/lib/System/Win32/DynamicLibrary.inc

Modified: llvm/trunk/lib/System/Win32/DynamicLibrary.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/DynamicLibrary.inc?rev=70299&r1=70298&r2=70299&view=diff

==============================================================================
--- llvm/trunk/lib/System/Win32/DynamicLibrary.inc (original)
+++ llvm/trunk/lib/System/Win32/DynamicLibrary.inc Tue Apr 28 11:37:58 2009
@@ -19,6 +19,10 @@
  #include <dbghelp.h>
 #endif
 
+#ifdef _MSC_VER
+ #include <ntverp.h>
+#endif
+
 #ifdef __MINGW32__
  #if (HAVE_LIBIMAGEHLP != 1)
   #error "libimagehlp.a should be present"
@@ -44,7 +48,14 @@
 #endif
 
 extern "C" {
-#if !defined(_MSC_VER) || _MSC_VER < 1500
+// Use old callback if:
+//  - Not using Visual Studio
+//  - Visual Studio 2005 or earlier but only if we are not using the Windows SDK 
+//    or Windows SDK version is older than 6.0
+// 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)
   static BOOL CALLBACK ELM_Callback(PSTR  ModuleName,
                                     ModuleBaseType ModuleBase,
                                     ULONG ModuleSize,





More information about the llvm-commits mailing list