Skip to content

Commit

Permalink
Merge pull request #198 from jefftrull/bugfix/more-fs-deprecation-rem…
Browse files Browse the repository at this point in the history
…oval

Handle some previously deprecated, now removed, filesystem code
  • Loading branch information
jefftrull authored Jan 15, 2024
2 parents abe718a + d8474c3 commit 6f4d8f7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
12 changes: 12 additions & 0 deletions include/boost/wave/util/filesystem_compatibility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <boost/version.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/directory.hpp>

namespace boost { namespace wave { namespace util
{
Expand Down Expand Up @@ -206,6 +207,17 @@ namespace boost { namespace wave { namespace util
return true;
return boost::filesystem::create_directories(p);
}

// starting with Boost 1.85 no_push was renamed to disable_recursion_pending for consistency
// with std::filesystem (deprecated some point before that)
inline void no_push(boost::filesystem::recursive_directory_iterator & it)
{
#if BOOST_VERSION >= 108400 && BOOST_FILESYSTEM_VERSION >= 3
it.disable_recursion_pending();
#else
it.no_push();
#endif
}
}}}

#endif
2 changes: 1 addition & 1 deletion samples/check_macro_naming/check_macro_naming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ int main(int argc, char *argv[])
exclude_dirs.end(),
fs::canonical(it->path())) != exclude_dirs.end())) {
// skip recursion here
it.no_push();
boost::wave::util::no_push(it);
}
}

Expand Down
3 changes: 2 additions & 1 deletion samples/waveidl/idl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <boost/assert.hpp>
#include <boost/program_options.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/wave/util/filesystem_compatibility.hpp>

///////////////////////////////////////////////////////////////////////////////
// Include Wave itself
Expand Down Expand Up @@ -475,7 +476,7 @@ main (int argc, char *argv[])
// started from. If this exists, treat it as a wave config file
fs::path filename = boost::wave::util::create_path(argv[0]);

filename = filename.branch_path() / "waveidl.cfg";
filename = boost::wave::util::branch_path(filename) / "waveidl.cfg";
cmd_line_util::read_config_file_options(filename.string(),
desc_overall_cfgfile, vm, true);

Expand Down
1 change: 0 additions & 1 deletion tool/cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
///////////////////////////////////////////////////////////////////////////////
// Include additional Boost libraries
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/timer/timer.hpp>
#include <boost/any.hpp>
Expand Down
1 change: 0 additions & 1 deletion tool/trace_macro_expansion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <boost/config.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/convenience.hpp>

#include <boost/wave/token_ids.hpp>
#include <boost/wave/util/macro_helpers.hpp>
Expand Down

0 comments on commit 6f4d8f7

Please sign in to comment.