summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-09-23 21:13:57 +0200
committerCarl Hetherington <cth@carlh.net>2024-09-23 21:13:57 +0200
commit466a21fbf04f9b5ee1bcddc0f9cee6c454799006 (patch)
tree2fca6c1d3104ab52718f5b7e8e4057a81ec1df3b
parentd82e972701165517517788b8b51eb089419a20cb (diff)
Another fix for new boost.
-rw-r--r--src/filesystem.cc6
-rw-r--r--wscript9
2 files changed, 15 insertions, 0 deletions
diff --git a/src/filesystem.cc b/src/filesystem.cc
index cb38ddfe..98c3d1b7 100644
--- a/src/filesystem.cc
+++ b/src/filesystem.cc
@@ -301,7 +301,13 @@ dcp::filesystem::rename(boost::filesystem::path const& old_path, boost::filesyst
boost::filesystem::path
dcp::filesystem::change_extension(boost::filesystem::path const& path, std::string const& new_extension)
{
+#ifdef LIBDCP_HAVE_REPLACE_EXTENSION
+ auto copy = path;
+ copy.replace_extension(new_extension);
+ return copy;
+#else
return boost::filesystem::change_extension(path, new_extension);
+#endif
}
diff --git a/wscript b/wscript
index 77cfa11f..a45a72a4 100644
--- a/wscript
+++ b/wscript
@@ -237,6 +237,15 @@ def configure(conf):
define_name='LIBDCP_HAVE_COPY_OPTIONS')
conf.check_cxx(fragment="""
+ #include <boost/filesystem.hpp>\n
+ int main() { boost::filesystem::path y = "foo"; y.replace_extension("bar"); }\n
+ """,
+ mandatory=False,
+ msg='Checking for boost::filesystem::replace_extension',
+ uselib='BOOST_FILESYSTEM',
+ define_name='LIBDCP_HAVE_REPLACE_EXTENSION')
+
+ conf.check_cxx(fragment="""
#include <boost/date_time.hpp>\n
int main() { boost::gregorian::day_clock::local_day(); }\n
""",