Switch to runtime concatenation of function name in data API error reporting to fix Linux compilation issue

This commit is contained in:
Mr-Wiseguy 2025-04-03 03:42:04 -04:00
parent d15d448d80
commit 1a6471a3a8

View File

@ -172,13 +172,18 @@ LockedSlotmap<MemorySlotmap> memory_slotmaps{};
#define REGISTER_FUNC(name) recomp::overlays::register_base_export(#name, name)
static void show_fatal_error_message_box(const char* funcname, const char* errstr) {
std::string message = std::string{"Fatal error in mod - "} + funcname + " : " + errstr;
recompui::message_box(message.c_str());
}
#define HANDLE_INVALID_ERROR() \
recompui::message_box("Fatal error in mod - " __FUNCTION__ " : handle is invalid"); \
show_fatal_error_message_box(__FUNCTION__, "handle is invalid"); \
assert(false); \
ultramodern::error_handling::quick_exit(__FILE__, __LINE__, __FUNCTION__);
#define SLOTMAP_KEY_INVALID_ERROR() \
recompui::message_box("Fatal error in mod - " __FUNCTION__ " : slotmap key is invalid"); \
show_fatal_error_message_box(__FUNCTION__, "slotmap key is invalid"); \
assert(false); \
ultramodern::error_handling::quick_exit(__FILE__, __LINE__, __FUNCTION__);