From 147ebefb1b977d20f2903b018d5417b90f885e03 Mon Sep 17 00:00:00 2001 From: James Whitworth Date: Fri, 19 Dec 2025 16:49:15 +0000 Subject: [PATCH 1/3] Fix the BOOST_PROCESS_V2_ASSIGN_LAST_ERROR macro when BOOST_PROCESS_STANDALONE is defined. `std::error_code::assign` takes two arguments and `::BOOST_PROCESS_V2_NAMESPACE::detail::get_last_error()` is already returning an error code so we can use the assignment operator instead. Also wrapped the statement in a do/while block for safety and to match the other macros in the file. --- include/boost/process/v2/detail/config.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/boost/process/v2/detail/config.hpp b/include/boost/process/v2/detail/config.hpp index 43d5b011b..231cab1d1 100644 --- a/include/boost/process/v2/detail/config.hpp +++ b/include/boost/process/v2/detail/config.hpp @@ -102,7 +102,11 @@ using std::optional; #define BOOST_PROCESS_V2_ASSIGN_EC(ec, ...) ec.assign(__VA_ARGS__); #define BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec) \ - ec.assign(::BOOST_PROCESS_V2_NAMESPACE::detail::get_last_error()); \ +do \ +{ \ + ec = ::BOOST_PROCESS_V2_NAMESPACE::detail::get_last_error(); \ +} \ +while (false) #else @@ -157,7 +161,7 @@ BOOST_PROCESS_V2_END_NAMESPACE #define BOOST_DYN_LINK #endif #include -#endif +#endif #if defined(BOOST_PROCESS_V2_POSIX) From 9f14a756021343b927ad1492ffbe8dc93a77069b Mon Sep 17 00:00:00 2001 From: James Whitworth Date: Fri, 19 Dec 2025 16:52:16 +0000 Subject: [PATCH 2/3] Remove spurious `v2::` namespace prefix in the Windows default_launcher implementation. This causes a compiler error when compiling with `BOOST_PROCESS_STANDALONE` defined. --- include/boost/process/v2/windows/default_launcher.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/process/v2/windows/default_launcher.hpp b/include/boost/process/v2/windows/default_launcher.hpp index 16ff12d46..29d13f261 100644 --- a/include/boost/process/v2/windows/default_launcher.hpp +++ b/include/boost/process/v2/windows/default_launcher.hpp @@ -250,7 +250,7 @@ struct default_launcher auto proc = (*this)(context, ec, executable, std::forward(args), std::forward(inits)...); if (ec) - v2::detail::throw_error(ec, "default_launcher"); + detail::throw_error(ec, "default_launcher"); return proc; } From de69da2bb4c98c8f7c2c0064d19fface9c99e411 Mon Sep 17 00:00:00 2001 From: James Whitworth Date: Fri, 19 Dec 2025 16:54:08 +0000 Subject: [PATCH 3/3] Add missing `std::` namespace qualifier for `std::is_convertible` in one of the basic_process constructor overloads. This was causing a compilation error when `BOOST_PROCESS_STANDALONE` was defined. --- include/boost/process/v2/process.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/process/v2/process.hpp b/include/boost/process/v2/process.hpp index 3ef167aa0..27b46c7cf 100644 --- a/include/boost/process/v2/process.hpp +++ b/include/boost/process/v2/process.hpp @@ -165,7 +165,7 @@ struct basic_process template explicit basic_process(ExecutionContext & context, typename std::enable_if< - is_convertible::value, void *>::type = nullptr) : process_handle_(context.get_executor()) {}