aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Win32
diff options
context:
space:
mode:
authorStefanus Du Toit <stefanus.dutoit@rapidmind.com>2009-04-28 16:37:58 +0000
committerStefanus Du Toit <stefanus.dutoit@rapidmind.com>2009-04-28 16:37:58 +0000
commitf0d13d56811d01d1612553df224e40901d4bffb6 (patch)
treeb2e71ab4d8ef66701b0f334125f081b04d7feb15 /lib/System/Win32
parentf78c6fadc28652a0e28507765a34173d23789591 (diff)
downloadexternal_llvm-f0d13d56811d01d1612553df224e40901d4bffb6.zip
external_llvm-f0d13d56811d01d1612553df224e40901d4bffb6.tar.gz
external_llvm-f0d13d56811d01d1612553df224e40901d4bffb6.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r--lib/System/Win32/DynamicLibrary.inc13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/System/Win32/DynamicLibrary.inc b/lib/System/Win32/DynamicLibrary.inc
index 3c35e6c..1ddf6ce 100644
--- a/lib/System/Win32/DynamicLibrary.inc
+++ b/lib/System/Win32/DynamicLibrary.inc
@@ -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 @@ static std::vector<HMODULE> OpenedHandles;
#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,