mirror of
https://github.com/holub/mame
synced 2025-04-21 16:01:56 +03:00
osd/windows: Send logerror to stderr if no debugger is attached and -oslog is on.
This commit is contained in:
parent
8b9c0940cf
commit
87822251d8
@ -6,20 +6,6 @@
|
||||
//
|
||||
//============================================================
|
||||
|
||||
// only for oslog callback
|
||||
#include <functional>
|
||||
|
||||
// standard windows headers
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <mmsystem.h>
|
||||
#include <tchar.h>
|
||||
#include <io.h>
|
||||
|
||||
// standard C headers
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
// MAME headers
|
||||
#include "emu.h"
|
||||
#include "emuopts.h"
|
||||
@ -34,6 +20,18 @@
|
||||
#include "modules/diagnostics/diagnostics_module.h"
|
||||
#include "modules/monitor/monitor_common.h"
|
||||
|
||||
// standard C headers
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// standard windows headers
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <mmsystem.h>
|
||||
#include <tchar.h>
|
||||
#include <io.h>
|
||||
|
||||
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
#include <wrl/client.h>
|
||||
using namespace Windows::Storage;
|
||||
@ -475,6 +473,8 @@ void windows_osd_interface::output_oslog(const char *buffer)
|
||||
{
|
||||
if (IsDebuggerPresent())
|
||||
win_output_debug_string_utf8(buffer);
|
||||
else
|
||||
fputs(buffer, stderr);
|
||||
}
|
||||
|
||||
|
||||
@ -573,10 +573,7 @@ void windows_osd_interface::init(running_machine &machine)
|
||||
|
||||
// hook up the debugger log
|
||||
if (options.oslog())
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
machine.add_logerror_callback(std::bind(&windows_osd_interface::output_oslog, this, _1));
|
||||
}
|
||||
machine.add_logerror_callback(&windows_osd_interface::output_oslog);
|
||||
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
// crank up the multimedia timer resolution to its max
|
||||
|
@ -312,7 +312,7 @@ protected:
|
||||
|
||||
private:
|
||||
virtual void osd_exit() override;
|
||||
void output_oslog(const char *buffer);
|
||||
static void output_oslog(const char *buffer);
|
||||
|
||||
windows_options & m_options;
|
||||
|
||||
|
@ -6,15 +6,15 @@
|
||||
//
|
||||
//============================================================
|
||||
|
||||
// standard windows headers
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// MAMEOS headers
|
||||
#include "winutf8.h"
|
||||
#include "strconv.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
// standard windows headers
|
||||
#include <shellapi.h>
|
||||
|
||||
|
||||
//============================================================
|
||||
// win_output_debug_string_utf8
|
||||
|
@ -6,11 +6,15 @@
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#ifndef __WINUTF8__
|
||||
#define __WINUTF8__
|
||||
#ifndef MAME_OSD_WINDOWS_WINUTF8_H
|
||||
#define MAME_OSD_WINDOWS_WINUTF8_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "osdcore.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// wrappers for kernel32.dll
|
||||
void win_output_debug_string_utf8(const char *string);
|
||||
|
||||
@ -18,8 +22,15 @@ void win_output_debug_string_utf8(const char *string);
|
||||
int win_message_box_utf8(HWND window, const char *text, const char *caption, UINT type);
|
||||
BOOL win_set_window_text_utf8(HWND window, const char *text);
|
||||
std::string win_get_window_text_utf8(HWND window);
|
||||
HWND win_create_window_ex_utf8(DWORD exstyle, const char* classname, const char* windowname, DWORD style,
|
||||
int x, int y, int width, int height, HWND wndparent, HMENU menu,
|
||||
HINSTANCE instance, void* param);
|
||||
HWND win_create_window_ex_utf8(
|
||||
DWORD exstyle,
|
||||
const char *classname,
|
||||
const char *windowname,
|
||||
DWORD style,
|
||||
int x, int y, int width, int height,
|
||||
HWND wndparent,
|
||||
HMENU menu,
|
||||
HINSTANCE instance,
|
||||
void *param);
|
||||
|
||||
#endif // __WINUTF8__
|
||||
#endif // MAME_OSD_WINDOWS_WINUTF8_H
|
||||
|
Loading…
Reference in New Issue
Block a user