From ba918b59faad5244d87078ab3b955f64fd803c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miodrag=20Milanovi=C4=87?= Date: Wed, 26 Jan 2022 13:21:02 +0100 Subject: [PATCH] Remove http related header pollution (#9201) * Remove http related header polution * remove now invalid message * fixed issued detected by clang * Fixed CR at EOF --- src/emu/emu.h | 3 --- src/emu/emufwd.h | 3 +++ src/emu/http.cpp | 3 +++ src/emu/http.h | 13 +++++++------ src/emu/machine.cpp | 1 + src/emu/main.cpp | 10 ++++++++++ src/emu/main.h | 4 ++-- src/frontend/mame/clifront.cpp | 1 + src/mame/machine/esqpanel.cpp | 1 + src/mame/machine/gaelco3d.h | 1 + 10 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/emu/emu.h b/src/emu/emu.h index d648ee932de..6ab48540666 100644 --- a/src/emu/emu.h +++ b/src/emu/emu.h @@ -34,9 +34,6 @@ #include "attotime.h" #include "profiler.h" -// http interface helpers -#include "http.h" - // commonly-referenced utilities imported from lib/util #include "corealloc.h" #include "palette.h" diff --git a/src/emu/emufwd.h b/src/emu/emufwd.h index 8b8e59b9250..13e6d40865a 100644 --- a/src/emu/emufwd.h +++ b/src/emu/emufwd.h @@ -152,6 +152,9 @@ class memory_view; // declared in emuopts.h class emu_options; +// declared in http.h +class http_manager; + // declared in gamedrv.h class game_driver; diff --git a/src/emu/http.cpp b/src/emu/http.cpp index f36244e31ac..8c95e731552 100644 --- a/src/emu/http.cpp +++ b/src/emu/http.cpp @@ -9,6 +9,9 @@ ***************************************************************************/ #include "emu.h" +#include "http.h" +#include "server_http.hpp" +#include "server_ws.hpp" #ifdef __sun #define ASIO_DISABLE_DEV_POLL diff --git a/src/emu/http.h b/src/emu/http.h index b0adf1e2b3d..e7c26d7980f 100644 --- a/src/emu/http.h +++ b/src/emu/http.h @@ -10,18 +10,12 @@ #pragma once -#ifndef __EMU_H__ -#error Dont include this file directly; include emu.h instead. -#endif - #ifndef MAME_EMU_HTTP_H #define MAME_EMU_HTTP_H #include #include #include -#include "server_http.hpp" -#include "server_ws.hpp" //************************************************************************** // TYPE DEFINITIONS @@ -33,6 +27,13 @@ namespace asio class io_context; } +namespace webpp +{ + class http_server; + class ws_server; + struct Connection; +} + class http_manager { DISABLE_COPYING(http_manager); diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index b70ffb69931..e76e4811abd 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -26,6 +26,7 @@ #include "tilemap.h" #include "natkeyboard.h" #include "ui/uimain.h" +#include "http.h" #include "corestr.h" #include "unzip.h" diff --git a/src/emu/main.cpp b/src/emu/main.cpp index e5467238238..6ce109ae1ef 100644 --- a/src/emu/main.cpp +++ b/src/emu/main.cpp @@ -10,6 +10,7 @@ #include "emu.h" #include "emuopts.h" +#include "http.h" machine_manager::machine_manager(emu_options& options, osd_interface& osd) : m_osd(osd), @@ -18,8 +19,17 @@ machine_manager::machine_manager(emu_options& options, osd_interface& osd) { } +machine_manager::~machine_manager() +{ +} + void machine_manager::start_http_server() { m_http = std::make_unique(options().http(), options().http_port(), options().http_root()); } + +http_manager *machine_manager::http() +{ + return m_http.get(); +} diff --git a/src/emu/main.h b/src/emu/main.h index 3c75205de14..89399e21690 100644 --- a/src/emu/main.h +++ b/src/emu/main.h @@ -71,7 +71,7 @@ protected: // construction/destruction machine_manager(emu_options& options, osd_interface& osd); public: - virtual ~machine_manager() { } + virtual ~machine_manager(); osd_interface &osd() const { return m_osd; } emu_options &options() const { return m_options; } @@ -88,7 +88,7 @@ public: virtual void update_machine() { } - http_manager *http() { return m_http.get(); } + http_manager *http(); void start_http_server(); protected: diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 312c96eff65..6a657a7735f 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -40,6 +40,7 @@ #include #include #include +#include //************************************************************************** diff --git a/src/mame/machine/esqpanel.cpp b/src/mame/machine/esqpanel.cpp index c860d4a4d0d..7629fc3c8f2 100644 --- a/src/mame/machine/esqpanel.cpp +++ b/src/mame/machine/esqpanel.cpp @@ -4,6 +4,7 @@ Ensoniq panel/display device */ #include "emu.h" +#include "http.h" #include "esqpanel.h" #define ESQPANEL_EXTERNAL_TIMER_ID 47000 diff --git a/src/mame/machine/gaelco3d.h b/src/mame/machine/gaelco3d.h index e4b1432b27c..05a09a8ee0a 100644 --- a/src/mame/machine/gaelco3d.h +++ b/src/mame/machine/gaelco3d.h @@ -10,6 +10,7 @@ #pragma once +#include /*************************************************************************** DEVICE INTERFACE TYPE