mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-19 01:07:00 -04:00
fix: support for upcoming Boost 1.87.0
io_service was deprecated and replaced by io_context in 1.66.0[^1]. The upcoming Boost 1.87.0 will remove the deprecated API[^2]. [^1]:b60e92b13e
[^2]:ec0908c562
This commit is contained in:
parent
d4d4081dfc
commit
b14b3b0545
@ -23,7 +23,7 @@
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/process.hpp>
|
||||
|
||||
#include <dwarfs/os_access.h>
|
||||
@ -79,7 +79,7 @@ std::optional<pager_program> find_pager_program(os_access const& os) {
|
||||
}
|
||||
|
||||
void show_in_pager(pager_program const& pager, std::string text) {
|
||||
boost::asio::io_service ios;
|
||||
boost::asio::io_context ios;
|
||||
bp::child proc(pager.name.wstring(), bp::args(pager.args),
|
||||
bp::std_in =
|
||||
boost::asio::const_buffer(text.data(), text.size()),
|
||||
|
@ -45,7 +45,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/process.hpp>
|
||||
|
||||
#include <fmt/format.h>
|
||||
@ -360,7 +360,7 @@ class subprocess {
|
||||
: subprocess(nullptr, prog, std::forward<Args>(args)...) {}
|
||||
|
||||
template <subprocess_arg... Args>
|
||||
subprocess(boost::asio::io_service& ios, std::filesystem::path const& prog,
|
||||
subprocess(boost::asio::io_context& ios, std::filesystem::path const& prog,
|
||||
Args&&... args)
|
||||
: subprocess(&ios, prog, std::forward<Args>(args)...) {}
|
||||
|
||||
@ -382,7 +382,7 @@ class subprocess {
|
||||
|
||||
void run() {
|
||||
if (!ios_) {
|
||||
throw std::runtime_error("processes with external io_service must be run "
|
||||
throw std::runtime_error("processes with external io_context must be run "
|
||||
"externally and then waited for");
|
||||
}
|
||||
ios_->run();
|
||||
@ -450,7 +450,7 @@ class subprocess {
|
||||
|
||||
private:
|
||||
template <subprocess_arg... Args>
|
||||
subprocess(boost::asio::io_service* ios, std::filesystem::path const& prog,
|
||||
subprocess(boost::asio::io_context* ios, std::filesystem::path const& prog,
|
||||
Args&&... args)
|
||||
: prog_{prog} {
|
||||
(append_arg(cmdline_, std::forward<Args>(args)), ...);
|
||||
@ -458,7 +458,7 @@ class subprocess {
|
||||
ignore_sigpipe();
|
||||
|
||||
if (!ios) {
|
||||
ios_ = std::make_unique<boost::asio::io_service>();
|
||||
ios_ = std::make_unique<boost::asio::io_context>();
|
||||
ios = ios_.get();
|
||||
}
|
||||
|
||||
@ -492,7 +492,7 @@ class subprocess {
|
||||
}
|
||||
|
||||
bp::child c_;
|
||||
std::unique_ptr<boost::asio::io_service> ios_;
|
||||
std::unique_ptr<boost::asio::io_context> ios_;
|
||||
std::future<std::string> out_;
|
||||
std::future<std::string> err_;
|
||||
std::string outs_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user