]> granicus.if.org Git - llvm/commitdiff
Workaround for incorrect Win32 header on GCC.
authorZachary Turner <zturner@google.com>
Wed, 17 May 2017 16:39:33 +0000 (16:39 +0000)
committerZachary Turner <zturner@google.com>
Wed, 17 May 2017 16:39:33 +0000 (16:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303272 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/CrashRecoveryContext.cpp

index f49630411e5522b5ac3111065ee739b24a480267..6ebde46203fc7470328ff966ffaafc6afd7f5785 100644 (file)
@@ -164,15 +164,13 @@ 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
+  // DBG_PRINTEXCEPTION_WIDE_C is not properly defined on all supported
+  // compilers and platforms, so we define it manually.
+  constexpr ULONG DbgPrintExceptionWideC = 0x4001000AL;
   switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
   {
   case DBG_PRINTEXCEPTION_C:
-  case WideDbgPrintValue:
+  case DbgPrintExceptionWideC:
   case 0x406D1388:  // set debugger thread name
     return EXCEPTION_CONTINUE_EXECUTION;
   }