Fix for compilers with older CRT header libraries.
authorZachary Turner <zturner@google.com>
Tue, 16 May 2017 22:59:34 +0000 (22:59 +0000)
committerZachary Turner <zturner@google.com>
Tue, 16 May 2017 22:59:34 +0000 (22:59 +0000)
llvm-svn: 303220

llvm/lib/Support/CrashRecoveryContext.cpp

index a8e34e5..f496304 100644 (file)
@@ -164,10 +164,15 @@ CrashRecoveryContext::unregisterCleanup(CrashRecoveryContextCleanup *cleanup) {
 
 static LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo)
 {
+#ifdef DBG_PRINTEXCEPTION_WIDE_C
+  constexpr ULONG WideDbgPrintValue = DBG_PRINTEXCEPTION_WIDE_C;
+#else
+  constexpr ULONG WideDbgPrintValue = 0x4001000AL;
+#endif
   switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
   {
   case DBG_PRINTEXCEPTION_C:
-  case DBG_PRINTEXCEPTION_WIDE_C:
+  case WideDbgPrintValue:
   case 0x406D1388:  // set debugger thread name
     return EXCEPTION_CONTINUE_EXECUTION;
   }