ULTRAMODERN_QUICK_EXIT macro

This commit is contained in:
angie 2024-06-07 11:16:01 -04:00
parent bdd42ccc7d
commit 2169fcb40b
3 changed files with 4 additions and 3 deletions

View file

@ -3,6 +3,8 @@
#include <cstdlib>
#define ULTRAMODERN_QUICK_EXIT() ultramodern::error_handling::quick_exit(__FILE__, __LINE__, __func__)
namespace ultramodern {
namespace error_handling {
struct callbacks_t {

View file

@ -215,7 +215,7 @@ void task_thread_func(uint8_t* rdram, moodycamel::LightweightSemaphore* thread_r
if (!ultramodern::rsp::run_task(PASS_RDRAM task)) {
fprintf(stderr, "Failed to execute task type: %" PRIu32 "\n", task->t.type);
ultramodern::error_handling::quick_exit(__FILE__, __LINE__, __func__);
ULTRAMODERN_QUICK_EXIT();
}
// Tell the game that the RSP has completed

View file

@ -14,8 +14,7 @@ void ultramodern::renderer::set_callbacks(const callbacks_t& callbacks) {
std::unique_ptr<ultramodern::renderer::RendererContext> ultramodern::renderer::create_render_context(uint8_t* rdram, WindowHandle window_handle, bool developer_mode) {
if (render_callbacks.create_render_context == nullptr) {
error_handling::message_box("[Error] The mandatory render callback `create_render_context` was not registered");
// TODO: should we make a macro for this?
error_handling::quick_exit(__FILE__, __LINE__, __func__);
ULTRAMODERN_QUICK_EXIT();
}
return render_callbacks.create_render_context(rdram, window_handle, developer_mode);