| 33 | } |
| 34 | |
| 35 | void internal_kpanic(BString msg) { |
| 36 | BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(logMutex); |
| 37 | if (KSystem::logFile.isOpen()) { |
| 38 | KSystem::logFile.write(msg); |
| 39 | } |
| 40 | fwrite(msg.c_str(), 1, msg.length(), stderr); |
| 41 | fflush(stderr); |
| 42 | #if defined(BOXEDWINE_MSVC) && defined(_DEBUG) |
| 43 | OutputDebugStringA(msg.c_str()); |
| 44 | #endif |
| 45 | if (KSystem::videoOption == VIDEO_NORMAL) { |
| 46 | #ifndef _TEST |
| 47 | KNativeSystem::exit(msg.c_str(), 1); |
| 48 | #endif |
| 49 | } else { |
| 50 | KNativeThread::sleep(5000); |
| 51 | } |
| 52 | exit(1); |
| 53 | } |
| 54 | |
| 55 | void kwarn(const char* msg) { |
| 56 | internal_log(BString::copy(msg) + "\n", stdout); |