Skip to content

Commit

Permalink
fix: Fix build with boost 1.85
Browse files Browse the repository at this point in the history
- Remove <boost/filesystem/convenience.hpp> header that has been removed
  from boost
- Replace deprecated filesystem::complete with filesystem::absolute
- Replace path::is_complete() with path::is_absolute()
- Replace path::leaf() with path::filename()
  • Loading branch information
oscarwcl committed Nov 1, 2024
1 parent 20a78f6 commit dec1a45
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common/env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void configure(const std::wstring& filename)
}

ftemplate =
clean_path(boost::filesystem::complete(paths.get(L"template-path", initial + L"/template/")).wstring());
clean_path(boost::filesystem::absolute(paths.get(L"template-path", initial + L"/template/")).wstring());
data = clean_path(paths.get(L"data-path", initial + L"/data/"));
} catch (...) {
CASPAR_LOG(error) << L" ### Invalid configuration file. ###";
Expand Down
2 changes: 1 addition & 1 deletion src/common/os/linux/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ std::optional<std::wstring> find_case_insensitive(const std::wstring& case_insen
bool found = false;

for (auto it = directory_iterator(absolute(result)); it != directory_iterator(); ++it) {
auto leaf = it->path().leaf();
auto leaf = it->path().filename();

if (boost::algorithm::iequals(part.wstring(), leaf.wstring(), loc)) {
result = result / leaf;
Expand Down
1 change: 0 additions & 1 deletion src/common/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/exception/all.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ffmpeg/consumer/ffmpeg_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ struct ffmpeg_consumer : public core::frame_consumer

static boost::regex prot_exp("^.+:.*");
if (!boost::regex_match(path_, prot_exp)) {
if (!full_path.is_complete()) {
if (!full_path.is_absolute()) {
full_path = u8(env::media_folder()) + path_;
}

Expand Down

0 comments on commit dec1a45

Please sign in to comment.