From 9d6c9a4e6eb4f2cae86a06b324bde4869fb6ad74 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Tue, 9 Apr 2019 13:00:22 -0400 Subject: [PATCH] fatal_printf - show an alert immediately. win32 - actually show the alert. --- src/glog.c | 5 ++++- src/win_console.c | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/glog.c b/src/glog.c index 856fca6..4a66fcf 100644 --- a/src/glog.c +++ b/src/glog.c @@ -12,6 +12,7 @@ #include "glog.h" +extern int x_show_alert(int fatal, const char *str); #define MAX_FATAL_LOGS 20 @@ -70,10 +71,12 @@ int fatal_printf(const char *fmt, ...) { glog(buffer); + x_show_alert(1, buffer); + /* if (g_fatal_log < MAX_FATAL_LOGS) { g_fatal_log_strs[g_fatal_log++] = strdup(buffer); } - + */ va_end(ap); return ret; diff --git a/src/win_console.c b/src/win_console.c index e946445..81a417a 100644 --- a/src/win_console.c +++ b/src/win_console.c @@ -60,7 +60,11 @@ void x_dialog_create_gsport_conf(const char *str) { config_write_config_gsplus_file(); } -int x_show_alert(int is_fatal, const char *str) { +int x_show_alert(int is_fatal, const char *str) { + + if (str && *str) { + MessageBox(NULL, str, "GS+", is_fatal ? MB_ICONERROR : MB_ICONWARNING); + } return 0; }