From ab7dba520c8efd2cfbdd71dd91ae6b60923a12cd Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 8 Dec 2022 21:13:47 +0300 Subject: Adapt to dir_iterator API change --- libbuild2/cc/guess.cxx | 2 +- libbuild2/cc/types.cxx | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'libbuild2/cc') diff --git a/libbuild2/cc/guess.cxx b/libbuild2/cc/guess.cxx index 2a6ae67..c7aef7b 100644 --- a/libbuild2/cc/guess.cxx +++ b/libbuild2/cc/guess.cxx @@ -761,7 +761,7 @@ namespace build2 // for (const dir_entry& de: dir_iterator (r.psdk_dir / dir_path ("Include"), - false /* ignore_dangling */)) + dir_iterator::no_follow)) { if (de.type () == entry_type::directory) { diff --git a/libbuild2/cc/types.cxx b/libbuild2/cc/types.cxx index 8ee4fa9..c6cfae9 100644 --- a/libbuild2/cc/types.cxx +++ b/libbuild2/cc/types.cxx @@ -6,6 +6,7 @@ #include using namespace std; +using namespace butl; namespace build2 { @@ -123,6 +124,8 @@ namespace build2 size_t importable_headers:: insert_angle_pattern (const dir_paths& sys_hdr_dirs, const string& pat) { + tracer trace ("importable_headers::insert_angle_pattern"); + assert (pat.front () == '<' && pat.back () == '>' && path_pattern (pat)); // First see if it has already been inserted. @@ -172,7 +175,17 @@ namespace build2 try { - path_search (f, process, dir); + path_search ( + f, + process, + dir, + path_match_flags::follow_symlinks, + [&trace] (const dir_entry& de) + { + l5 ([&]{trace << "skipping inaccessible/dangling entry " + << de.base () / de.path ();}); + return true; + }); } catch (const system_error& e) { -- cgit v1.1