diff --git a/meson.build b/meson.build index b3e87bb6..8500a41b 100644 --- a/meson.build +++ b/meson.build @@ -58,7 +58,7 @@ compiler_options = [ chainloader_compiler_options = [ # We use our process library for sending notifications from the chainloaders, # but we don't need the Asio pipe support there - '-DPROCESS_NO_ASIO', + '-DWITHOUT_ASIO', ] # HACK: Some stuff from `windows.h` that we don't need results in conflicting diff --git a/src/common/logging/common.cpp b/src/common/logging/common.cpp index 6ba67425..753430ba 100644 --- a/src/common/logging/common.cpp +++ b/src/common/logging/common.cpp @@ -16,8 +16,6 @@ #include "common.h" -#include - #include #include #include diff --git a/src/common/logging/common.h b/src/common/logging/common.h index 4b3426ef..df515016 100644 --- a/src/common/logging/common.h +++ b/src/common/logging/common.h @@ -20,12 +20,16 @@ #include #include +// The chainloader needs to be able to use the logger without pulling in a bunch +// of Boost things +#ifndef WITHOUT_ASIO #ifdef __WINE__ #include "../wine-host/asio-fix.h" #endif #include #include +#endif // WITHOUT_ASIO #include "../utils.h" @@ -138,6 +142,7 @@ class Logger { */ void log(const std::string& message); +#ifndef WITHOUT_ASIO /** * Write output from an async pipe to the log on a line by line basis. * Useful for logging the Wine process's STDOUT and STDERR streams. @@ -167,6 +172,7 @@ class Logger { async_log_pipe_lines(pipe, buffer, prefix); }); } +#endif // WITHOUT_ASIO /** * Log a message that should only be printed when the `verbosity` is set to diff --git a/src/common/process.cpp b/src/common/process.cpp index 51904387..1f183261 100644 --- a/src/common/process.cpp +++ b/src/common/process.cpp @@ -314,7 +314,7 @@ Process::StatusResult Process::spawn_get_status() const { } } -#ifndef PROCESS_NO_ASIO +#ifndef WITHOUT_ASIO Process::HandleResult Process::spawn_child_piped( // NOLINTNEXTLINE(bugprone-easily-swappable-parameters) asio::posix::stream_descriptor& stdout_pipe, @@ -385,7 +385,7 @@ Process::HandleResult Process::spawn_child_piped( return Handle(child_pid); } } -#endif // PROCESS_NO_ASIO +#endif // WITHOUT_ASIO Process::HandleResult Process::spawn_child_redirected( const ghc::filesystem::path& filename) const { diff --git a/src/common/process.h b/src/common/process.h index ba9014a7..dabb2d44 100644 --- a/src/common/process.h +++ b/src/common/process.h @@ -26,13 +26,13 @@ // We also use this header from the chainloaders, and we don't want to pull in // Asio there -#ifndef PROCESS_NO_ASIO +#ifndef WITHOUT_ASIO #ifdef __WINE__ #include "../wine-host/asio-fix.h" #endif #include -#endif // PROCESS_NO_ASIO +#endif // WITHOUT_ASIO // A minimal API akin to Boost.Process for launching and managing processes // using plain Linux APIs. Needed so we can implement our chainloader without @@ -240,7 +240,7 @@ class Process { */ StatusResult spawn_get_status() const; -#ifndef PROCESS_NO_ASIO +#ifndef WITHOUT_ASIO /** * Spawn the process without waiting for its completion, leave STDIN alone, * create pipes for STDOUT and STDERR, and assign those to the provided @@ -251,7 +251,7 @@ class Process { HandleResult spawn_child_piped( asio::posix::stream_descriptor& stdout_pipe, asio::posix::stream_descriptor& stderr_pipe) const; -#endif // PROCESS_NO_ASIO +#endif // WITHOUT_ASIO /** * Spawn the process without waiting for its completion, leave STDIN alone,