| 778 | // Assertions and such |
| 779 | |
| 780 | NORETURN static void _BreakStrToDebugger(const char *mesg, bool assert) |
| 781 | { |
| 782 | UNUSED(assert); |
| 783 | // FIXME: this needs a way to get the SDL_window in windowmanager-sdl.cc |
| 784 | #if 0 |
| 785 | #if defined(USE_TILE_LOCAL) && defined(TARGET_OS_WINDOWS) |
| 786 | SDL_SysWMinfo SysInfo; |
| 787 | SDL_VERSION(&SysInfo.version); |
| 788 | if (SDL_GetWindowWMInfo(window, &SysInfo) > 0) |
| 789 | { |
| 790 | MessageBoxW(window, OUTW(mesg), |
| 791 | assert ? L"Assertion failed!" : L"Error", |
| 792 | MB_OK|MB_ICONERROR); |
| 793 | } |
| 794 | // Print the message to STDERR in addition to the above message box, |
| 795 | // so it's in the message history if we call Crawl from a shell. |
| 796 | #endif |
| 797 | #endif |
| 798 | fprintf(stderr, "%s\n", mesg); |
| 799 | |
| 800 | #if defined(TARGET_OS_WINDOWS) |
| 801 | OutputDebugString(mesg); |
| 802 | if (IsDebuggerPresent()) |
| 803 | DebugBreak(); |
| 804 | #endif |
| 805 | |
| 806 | // MSVCRT's abort() give's a funny message ... |
| 807 | raise(SIGABRT); |
| 808 | abort(); |
| 809 | } |
| 810 | |
| 811 | #ifdef ASSERTS |
| 812 | NORETURN void AssertFailed(const char *expr, const char *file, int line, |
no test coverage detected