From 068c4bfa1e2064593a8b66d8c07051f7ad0fe4ea Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Fri, 6 Sep 2024 16:57:57 +0000 Subject: [PATCH] Fix compilation with boost 1.86 --- client/ServerRunner.cpp | 12 ++++++++++-- client/ServerRunner.h | 13 +++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/client/ServerRunner.cpp b/client/ServerRunner.cpp index 2a7a0791e..2979a757f 100644 --- a/client/ServerRunner.cpp +++ b/client/ServerRunner.cpp @@ -15,11 +15,19 @@ #include "../lib/CThreadHelper.h" #include "../server/CVCMIServer.h" -#ifndef VCMI_MOBILE +#ifdef ENABLE_SERVER_PROCESS + +#if BOOST_VERSION >= 108600 +// TODO: upgrade code to use v2 API instead of deprecated v1 +#include +#include +#else #include #include #endif +#endif + #include ServerThreadRunner::ServerThreadRunner() = default; @@ -66,7 +74,7 @@ int ServerThreadRunner::exitCode() return 0; } -#ifndef VCMI_MOBILE +#ifdef ENABLE_SERVER_PROCESS ServerProcessRunner::ServerProcessRunner() = default; ServerProcessRunner::~ServerProcessRunner() = default; diff --git a/client/ServerRunner.h b/client/ServerRunner.h index d5ba38b53..313a61a03 100644 --- a/client/ServerRunner.h +++ b/client/ServerRunner.h @@ -44,10 +44,23 @@ public: }; #ifndef VCMI_MOBILE +// Enable support for running vcmiserver as separate process. Unavailable on mobile systems +#define ENABLE_SERVER_PROCESS +#endif +#ifdef ENABLE_SERVER_PROCESS + +#if BOOST_VERSION >= 108600 +namespace boost::process { +inline namespace v1 { +class child; +} +} +#else namespace boost::process { class child; } +#endif /// Class that runs server instance as a child process /// Available only on desktop systems where process management is allowed