summaryrefslogtreecommitdiff
path: root/Source/Core/Common/MsgHandler.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-06-16 23:24:26 -0400
committerLioncash <mathew1800@gmail.com>2019-06-16 23:37:00 -0400
commit027c17558fde26c51688e44707f6eb3a13c67be4 (patch)
treefbac7637fa306a174d816dc4b9e8ae9a9186925b /Source/Core/Common/MsgHandler.cpp
parentb3525ad774b336ac22137a1f5bb31a5c0d2a2154 (diff)
Common/MsgHandler: Use fmt::print on non-Windows OSes
Provides the same behavior.
Diffstat (limited to 'Source/Core/Common/MsgHandler.cpp')
-rw-r--r--Source/Core/Common/MsgHandler.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/Core/Common/MsgHandler.cpp b/Source/Core/Common/MsgHandler.cpp
index 43f24c9865..01a51a7e3f 100644
--- a/Source/Core/Common/MsgHandler.cpp
+++ b/Source/Core/Common/MsgHandler.cpp
@@ -2,20 +2,23 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
+#include "Common/MsgHandler.h"
+
#include <cstdarg>
-#include <cstdio>
#include <string>
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <cstdio>
+#include <fmt/format.h>
+#endif
+
#include "Common/Common.h"
#include "Common/CommonTypes.h"
#include "Common/Logging/Log.h"
-#include "Common/MsgHandler.h"
#include "Common/StringUtil.h"
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, MsgType style);
static MsgAlertHandler msg_handler = DefaultMsgHandler;
static bool AlertEnabled = true;
@@ -111,7 +114,7 @@ bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, MsgTy
return IDYES == MessageBox(0, UTF8ToTStr(text).c_str(), UTF8ToTStr(caption).c_str(),
window_style | (yes_no ? MB_YESNO : MB_OK));
#else
- fprintf(stderr, "%s\n", text);
+ fmt::print(stderr, "{}\n", text);
// Return no to any question (which will in general crash the emulator)
return false;