From 46b71d5e96e7a82860841c6015cc487525124c3e Mon Sep 17 00:00:00 2001 From: Klemens Morgenstern Date: Fri, 25 Oct 2024 08:13:48 +0800 Subject: [PATCH] Switched #error to ENOTSUP for ext libs. Should help #413 Closes #358. --- src/ext/cmd.cpp | 6 +++++- src/ext/cwd.cpp | 6 +++++- src/ext/exe.cpp | 6 +++++- src/pid.cpp | 16 +++++++++++++++- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/ext/cmd.cpp b/src/ext/cmd.cpp index d74a06ef..c526c1e8 100644 --- a/src/ext/cmd.cpp +++ b/src/ext/cmd.cpp @@ -394,7 +394,11 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec) } #else -#error "Platform not supported" +filesystem::path cmd(boost::process::v2::pid_type, boost::system::error_code & ec) +{ + BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, boost::system::system_category()) + return ""; +} #endif shell cmd(boost::process::v2::pid_type pid) diff --git a/src/ext/cwd.cpp b/src/ext/cwd.cpp index 3345d33b..6f13eb83 100644 --- a/src/ext/cwd.cpp +++ b/src/ext/cwd.cpp @@ -197,7 +197,11 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code } #else -#error "Platform not supported" +filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec) +{ + BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, boost::system::system_category()) + return ""; +} #endif filesystem::path cwd(boost::process::v2::pid_type pid) diff --git a/src/ext/exe.cpp b/src/ext/exe.cpp index 82482644..8a57d982 100644 --- a/src/ext/exe.cpp +++ b/src/ext/exe.cpp @@ -175,7 +175,11 @@ filesystem::path exe(boost::process::v2::pid_type pid, boost::system::error_code } #else -#error "Platform not supported" +filesystem::path exe(boost::process::v2::pid_type pid, boost::system::error_code & ec) +{ + BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, boost::system::system_category()) + return ""; +} #endif filesystem::path exe(boost::process::v2::pid_type pid) diff --git a/src/pid.cpp b/src/pid.cpp index 5f29ea36..ff5f1b1c 100644 --- a/src/pid.cpp +++ b/src/pid.cpp @@ -727,7 +727,21 @@ std::vector child_pids(pid_type pid, boost::system::error_code & ec) } #else -#error "Platform not supported" +std::vector all_pids(boost::system::error_code & ec) +{ + BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category()); + return {}; +} +pid_type parent_pid(pid_type pid, boost::system::error_code & ec) +{ + BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category()); + return pid; +} +std::vector child_pids(pid_type, boost::system::error_code & ec) +{ + BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category()); + return {}; +} #endif std::vector all_pids()