diff --git a/include/boost/process/detail/posix/search_path.hpp b/include/boost/process/detail/posix/search_path.hpp index e06f4163..b409642a 100644 --- a/include/boost/process/detail/posix/search_path.hpp +++ b/include/boost/process/detail/posix/search_path.hpp @@ -27,7 +27,11 @@ inline boost::process::filesystem::path search_path( for (const boost::process::filesystem::path & pp : path) { auto p = pp / filename; +#if defined(BOOST_PROCESS_USE_STD_FS) + std::error_code ec; +#else boost::system::error_code ec; +#endif bool file = boost::process::filesystem::is_regular_file(p, ec); if (!ec && file && ::access(p.c_str(), X_OK) == 0) return p; diff --git a/include/boost/process/detail/windows/search_path.hpp b/include/boost/process/detail/windows/search_path.hpp index 1aa0b813..5817a304 100644 --- a/include/boost/process/detail/windows/search_path.hpp +++ b/include/boost/process/detail/windows/search_path.hpp @@ -63,7 +63,11 @@ inline boost::process::filesystem::path search_path( { boost::process::filesystem::path pp_ext = p; pp_ext += ext; +#if defined(BOOST_PROCESS_USE_STD_FS) + std::error_code ec; +#else boost::system::error_code ec; +#endif bool file = boost::process::filesystem::is_regular_file(pp_ext, ec); if (!ec && file && ::boost::winapi::sh_get_file_info(pp_ext.native().c_str(), 0, 0, 0, ::boost::winapi::SHGFI_EXETYPE_))