libcmo21/LibCmo/VTUtils.cpp

37 lines
611 B
C++
Raw Normal View History

2023-02-25 22:58:28 +08:00
#include "VTUtils.hpp"
#if defined(LIBCMO_OS_WIN32)
#include <intrin.h>
// disable annoy macro at the same time
#undef GetObject
#undef GetClassName
#undef LoadImage
#undef GetTempPath
#else
#include <signal.h>
#endif
2023-02-25 22:58:28 +08:00
namespace LibCmo {
2023-08-23 16:04:58 +08:00
2023-08-25 21:57:22 +08:00
void LibPanic(int line, const char* file, const char* errmsg) {
fprintf(stderr, "LIBCMO PANIC:%s (%s:L%d)\n",
errmsg ? errmsg : "", file, line);
std::abort();
}
void LibOrderDebugger() {
#if defined(LIBCMO_BUILD_DEBUG)
#if defined(LIBCMO_OS_WIN32)
// win32 debug break
__debugbreak();
#else
// generic debug break
raise(SIGTRAP);
#endif
#endif
}
2023-02-25 22:58:28 +08:00
}