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) 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()) {} 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; }