diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-22 15:58:35 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-22 15:58:35 +0000 |
commit | 441722f4b863b8b9ac8410c2c36217596252dbd6 (patch) | |
tree | b470cd3922c31214f08699807b20005d95ea76a8 | |
parent | ed6353b87ccbbf7ddaa63a25bfad14afc3079da0 (diff) | |
download | external_llvm-441722f4b863b8b9ac8410c2c36217596252dbd6.zip external_llvm-441722f4b863b8b9ac8410c2c36217596252dbd6.tar.gz external_llvm-441722f4b863b8b9ac8410c2c36217596252dbd6.tar.bz2 |
Hide MSVC specific CRT interaction behind _MSC_VER.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82551 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/System/Win32/Signals.inc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/System/Win32/Signals.inc b/lib/System/Win32/Signals.inc index 699df76..ca43bbf 100644 --- a/lib/System/Win32/Signals.inc +++ b/lib/System/Win32/Signals.inc @@ -58,6 +58,7 @@ namespace llvm { //=== 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 @@ static int CRTReportHook(int ReportType, char *Message, int *Return) { // Don't call _CrtDbgReport. return TRUE; } +#endif static void RegisterHandler() { if (RegisteredUnhandledExceptionFilter) { @@ -106,10 +108,12 @@ static void RegisterHandler() { 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 @@ static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) { 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) |