Index: lib/Support/Windows/Signals.inc =================================================================== --- lib/Support/Windows/Signals.inc +++ lib/Support/Windows/Signals.inc @@ -275,12 +275,15 @@ // Crash to stack trace handler on abort. signal(SIGABRT, HandleAbort); - // The following functions are not reliably accessible on MinGW. -#ifdef _MSC_VER + // The following functions are only available on MinGW if a sufficiently + // current MSVCRT is used (the corresponding runtimes must be installed). +#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x900 // We're already handling writing a "something went wrong" message. _set_abort_behavior(0, _WRITE_ABORT_MSG); // Disable Dr. Watson. _set_abort_behavior(0, _CALL_REPORTFAULT); +#endif +#ifdef _MSC_VER _CrtSetReportHook(AvoidMessageBoxHook); #endif