Replace most uses of Boost.{Filesystem,Process}

With the `ghc::filesystem` dependency from the previous commit. If we
can replace the rest of the Boost.Filesystem dependency then we can get
rid the one nasty runtime dependency we have, and it will make
implementing the chainloading simpler since can reuse more code without
bringing in Boost.
This commit is contained in:
Robbert van der Helm
2022-04-10 18:35:55 +02:00
parent 49b2ad46ab
commit d2d4cf4ea9
25 changed files with 135 additions and 133 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ constexpr int extended_max_win32_messages = 8192;
constexpr unsigned int juce_message_id = WM_USER + 123;
HostBridge::HostBridge(MainContext& main_context,
boost::filesystem::path plugin_path,
ghc::filesystem::path plugin_path,
pid_t parent_pid)
: plugin_path_(plugin_path),
main_context_(main_context),
+3 -3
View File
@@ -18,7 +18,7 @@
#include "../boost-fix.h"
#include <boost/filesystem.hpp>
#include <ghc/filesystem.hpp>
#include "../../common/logging/common.h"
#include "../utils.h"
@@ -33,7 +33,7 @@
class HostBridge {
protected:
HostBridge(MainContext& main_context,
boost::filesystem::path plugin_path,
ghc::filesystem::path plugin_path,
pid_t parent_pid);
public:
@@ -98,7 +98,7 @@ class HostBridge {
/**
* The path to the .dll being loaded in the Wine plugin host.
*/
const boost::filesystem::path plugin_path_;
const ghc::filesystem::path plugin_path_;
protected:
/**
+3 -4
View File
@@ -19,7 +19,6 @@
#include "../boost-fix.h"
#include <unistd.h>
#include <boost/process/environment.hpp>
#include <regex>
#include "../../common/communication/common.h"
@@ -30,7 +29,7 @@
// FIXME: `std::filesystem` is broken in wineg++, at least under Wine 5.8. Any
// path operation will thrown an encoding related error
namespace fs = boost::filesystem;
namespace fs = ghc::filesystem;
using namespace std::literals::chrono_literals;
@@ -86,7 +85,7 @@ StdIoCapture::~StdIoCapture() noexcept {
close(pipe_fd_[0]);
}
GroupBridge::GroupBridge(boost::filesystem::path group_socket_path)
GroupBridge::GroupBridge(ghc::filesystem::path group_socket_path)
: logger_(Logger::create_from_environment(
create_logger_prefix(group_socket_path))),
main_context_(),
@@ -191,7 +190,7 @@ void GroupBridge::accept_requests() {
// this process to crash during its initialization to prevent
// waiting indefinitely on the sockets to be connected to.
const auto request = read_object<HostRequest>(socket);
write_object(socket, HostResponse{boost::this_process::get_id()});
write_object(socket, HostResponse{.pid = getpid()});
// The plugin has to be initiated on the IO context's thread because
// this has to be done on the same thread that's handling messages,
+1 -1
View File
@@ -123,7 +123,7 @@ class GroupBridge {
* STDOUT and STDERR streams of the current process will be redirected to
* a pipe so they can be properly written to a log file.
*/
explicit GroupBridge(boost::filesystem::path group_socket_path);
explicit GroupBridge(ghc::filesystem::path group_socket_path);
~GroupBridge() noexcept;