1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix compilation with boost 1.86

This commit is contained in:
Ivan Savenko 2024-09-06 16:57:57 +00:00
parent 6179521364
commit 068c4bfa1e
2 changed files with 23 additions and 2 deletions

View File

@ -15,11 +15,19 @@
#include "../lib/CThreadHelper.h" #include "../lib/CThreadHelper.h"
#include "../server/CVCMIServer.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 <boost/process/v1/child.hpp>
#include <boost/process/v1/io.hpp>
#else
#include <boost/process/child.hpp> #include <boost/process/child.hpp>
#include <boost/process/io.hpp> #include <boost/process/io.hpp>
#endif #endif
#endif
#include <future> #include <future>
ServerThreadRunner::ServerThreadRunner() = default; ServerThreadRunner::ServerThreadRunner() = default;
@ -66,7 +74,7 @@ int ServerThreadRunner::exitCode()
return 0; return 0;
} }
#ifndef VCMI_MOBILE #ifdef ENABLE_SERVER_PROCESS
ServerProcessRunner::ServerProcessRunner() = default; ServerProcessRunner::ServerProcessRunner() = default;
ServerProcessRunner::~ServerProcessRunner() = default; ServerProcessRunner::~ServerProcessRunner() = default;

View File

@ -44,10 +44,23 @@ public:
}; };
#ifndef VCMI_MOBILE #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 { namespace boost::process {
class child; class child;
} }
#endif
/// Class that runs server instance as a child process /// Class that runs server instance as a child process
/// Available only on desktop systems where process management is allowed /// Available only on desktop systems where process management is allowed