Skip to content
Permalink
Browse files

Common/MsgHandler: Use fmt::print on non-Windows OSes

Provides the same behavior.
  • Loading branch information...
lioncash committed Jun 17, 2019
1 parent b3525ad commit 027c17558fde26c51688e44707f6eb3a13c67be4
Showing with 10 additions and 7 deletions.
  1. +10 −7 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;

0 comments on commit 027c175

Please sign in to comment.
You can’t perform that action at this time.