diff --git a/uppbox/MakeInstall7/Main.cpp b/uppbox/MakeInstall7/Main.cpp index ae4f9909b..0f2691748 100644 --- a/uppbox/MakeInstall7/Main.cpp +++ b/uppbox/MakeInstall7/Main.cpp @@ -5,7 +5,7 @@ // win32 installation is supposed to be in ~/upp.win32 (for umk.exe and clang binaries) // current upp source in ~/upp.src // wine must map home directory to u:/ -// not that build method is defined in this package (and referenced as +// note that build method is defined in this package (and referenced as // u:/upp.src/uppbox/MakeInstall7/CLANGx64.bm) using namespace Upp; diff --git a/uppsrc/Core/Util.cpp b/uppsrc/Core/Util.cpp index f975b3ca6..d0f849f1f 100644 --- a/uppsrc/Core/Util.cpp +++ b/uppsrc/Core/Util.cpp @@ -94,35 +94,35 @@ void Panic(const char *msg) signal(SIGBUS, SIG_DFL); signal(SIGFPE, SIG_DFL); #endif - if(PanicMode) - return; - PanicMode = true; - RLOG("****************** PANIC: " << msg << "\n"); - PanicMessageBox("Fatal error", msg); - -#ifdef PLATFORM_WIN32 -# ifdef __NOASSEMBLY__ -# if defined(PLATFORM_WINCE) || defined(WIN64) - DebugBreak(); -# endif -# else -# if defined(_DEBUG) && defined(CPU_X86) -# ifdef COMPILER_MSC - _asm int 3 -# endif -# ifdef COMPILER_GCC - asm("int $3"); -# endif -# endif -# endif -#else -#endif -#ifdef PLATFORM_POSIX - raise(SIGTRAP); -#endif -#ifdef _DEBUG - __BREAK__; -#endif + if(!PanicMode) { + PanicMode = true; + RLOG("****************** PANIC: " << msg << "\n"); + PanicMessageBox("Fatal error", msg); + + #ifdef PLATFORM_WIN32 + # ifdef __NOASSEMBLY__ + # if defined(PLATFORM_WINCE) || defined(WIN64) + DebugBreak(); + # endif + # else + # if defined(_DEBUG) && defined(CPU_X86) + # ifdef COMPILER_MSC + _asm int 3 + # endif + # ifdef COMPILER_GCC + asm("int $3"); + # endif + # endif + # endif + #else + #endif + #ifdef PLATFORM_POSIX + raise(SIGTRAP); + #endif + #ifdef _DEBUG + __BREAK__; + #endif + } abort(); } @@ -135,49 +135,49 @@ void SetAssertFailedHook(void (*h)(const char *)) void AssertFailed(const char *file, int line, const char *cond) { - if(PanicMode) - return; - PanicMode = true; - char s[2048]; - snprintf(s, 2048, "Assertion failed in %s, line %d\n%s\n", file, line, cond); -#if defined(PLATFORM_LINUX) && defined(COMPILER_GCC) && defined(flagSTACKTRACE) - AddStackTrace(s, sizeof(s)); -#endif - - if(s_assert_hook) - (*s_assert_hook)(s); - RLOG("****************** ASSERT FAILED: " << s << "\n"); -#ifdef PLATFORM_POSIX - RLOG("LastErrorMessage: " << strerror(errno)); // do not translate -#else - RLOG("LastErrorMessage: " << GetLastErrorMessage()); -#endif - - PanicMessageBox("Fatal error", s); - -#ifdef PLATFORM_WIN32 -# ifdef __NOASSEMBLY__ -# if defined(PLATFORM_WINCE) || defined(WIN64) - DebugBreak(); -# endif -# else -# if defined(_DEBUG) && defined(CPU_X86) -# ifdef COMPILER_MSC - _asm int 3 -# endif -# ifdef COMPILER_GCC - asm("int $3"); -# endif -# endif -# endif -#else -#endif -#ifdef PLATFORM_POSIX - raise(SIGTRAP); -#endif -#ifdef _DEBUG - __BREAK__; -#endif + if(!PanicMode) { + PanicMode = true; + char s[2048]; + snprintf(s, 2048, "Assertion failed in %s, line %d\n%s\n", file, line, cond); + #if defined(PLATFORM_LINUX) && defined(COMPILER_GCC) && defined(flagSTACKTRACE) + AddStackTrace(s, sizeof(s)); + #endif + + if(s_assert_hook) + (*s_assert_hook)(s); + RLOG("****************** ASSERT FAILED: " << s << "\n"); + #ifdef PLATFORM_POSIX + RLOG("LastErrorMessage: " << strerror(errno)); // do not translate + #else + RLOG("LastErrorMessage: " << GetLastErrorMessage()); + #endif + + PanicMessageBox("Fatal error", s); + + #ifdef PLATFORM_WIN32 + # ifdef __NOASSEMBLY__ + # if defined(PLATFORM_WINCE) || defined(WIN64) + DebugBreak(); + # endif + # else + # if defined(_DEBUG) && defined(CPU_X86) + # ifdef COMPILER_MSC + _asm int 3 + # endif + # ifdef COMPILER_GCC + asm("int $3"); + # endif + # endif + # endif + #else + #endif + #ifdef PLATFORM_POSIX + raise(SIGTRAP); + #endif + #ifdef _DEBUG + __BREAK__; + #endif + } abort(); }