libcmo21/LibCmo/VTUtils.cpp
yyc12345 b2d0b743cb improve proj
- remove VTImage.hpp to make sure stb image do not need external project to ref.
- finish CKStateChunk write part. add some compatibilty code.
- add debugger pause function
- add filename getter for CKPathManager.
2023-09-24 20:56:23 +08:00

37 lines
611 B
C++

#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
namespace LibCmo {
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
}
}