[llvm-commits] [llvm] r82551 - /llvm/trunk/lib/System/Win32/Signals.inc
Daniel Dunbar
daniel at zuster.org
Tue Sep 22 08:58:35 PDT 2009
Author: ddunbar
Date: Tue Sep 22 10:58:35 2009
New Revision: 82551
URL: http://llvm.org/viewvc/llvm-project?rev=82551&view=rev
Log:
Hide MSVC specific CRT interaction behind _MSC_VER.
Modified:
llvm/trunk/lib/System/Win32/Signals.inc
Modified: llvm/trunk/lib/System/Win32/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Signals.inc?rev=82551&r1=82550&r2=82551&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Signals.inc (original)
+++ llvm/trunk/lib/System/Win32/Signals.inc Tue Sep 22 10:58:35 2009
@@ -58,6 +58,7 @@
//=== and must not be UNIX code
//===----------------------------------------------------------------------===//
+#ifdef _MSC_VER
/// CRTReportHook - Function called on a CRT debugging event.
static int CRTReportHook(int ReportType, char *Message, int *Return) {
// Don't cause a DebugBreak() on return.
@@ -86,6 +87,7 @@
// Don't call _CrtDbgReport.
return TRUE;
}
+#endif
static void RegisterHandler() {
if (RegisteredUnhandledExceptionFilter) {
@@ -106,10 +108,12 @@
SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE);
// Environment variable to disable any kind of crash dialog.
+#ifdef _MSC_VER
if (getenv("LLVM_DISABLE_CRT_DEBUG")) {
_CrtSetReportHook(CRTReportHook);
- ExitOnUnhandledExceptions = true;
+ ExitOnUnhandledExceptions = true;
}
+#endif
// IMPORTANT NOTE: Caller must call LeaveCriticalSection(&CriticalSection) or
// else multi-threading problems will ensue.
@@ -270,8 +274,10 @@
assert(0 && "Crashed in LLVMUnhandledExceptionFilter");
}
+#ifdef _MSC_VER
if (ExitOnUnhandledExceptions)
_exit(-3);
+#endif
// Allow dialog box to pop up allowing choice to start debugger.
if (OldFilter)
More information about the llvm-commits
mailing list