From 8ad3e7396597ffcf56f3ad74c00dfc6fdcd504df Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 25 Jul 2012 20:25:47 +0000 Subject: [PATCH] Make Cycles compatible with older boost versions. Patch by IRIE Shinsuke, thanks! --- intern/cycles/util/util_cache.cpp | 8 ++++++++ intern/cycles/util/util_path.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/intern/cycles/util/util_cache.cpp b/intern/cycles/util/util_cache.cpp index 2924ed30b88..d09e256c891 100644 --- a/intern/cycles/util/util_cache.cpp +++ b/intern/cycles/util/util_cache.cpp @@ -26,6 +26,10 @@ #include "util_path.h" #include "util_types.h" +#if (BOOST_VERSION < 104400) +# define BOOST_FILESYSTEM_VERSION 2 +#endif + #include #include @@ -115,7 +119,11 @@ void Cache::clear_except(const string& name, const set& except) boost::filesystem::directory_iterator it(dir), it_end; for(; it != it_end; it++) { +#if (BOOST_FILESYSTEM_VERSION == 2) + string filename = it->path().filename(); +#else string filename = it->path().filename().string(); +#endif if(boost::starts_with(filename, name)) if(except.find(filename) == except.end()) diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp index 53dbfe9a42c..f6b70bfb73f 100644 --- a/intern/cycles/util/util_path.cpp +++ b/intern/cycles/util/util_path.cpp @@ -26,6 +26,10 @@ OIIO_NAMESPACE_USING #include +#if (BOOST_VERSION < 104400) +# define BOOST_FILESYSTEM_VERSION 2 +#endif + #include #include @@ -58,7 +62,11 @@ string path_user_get(const string& sub) string path_filename(const string& path) { +#if (BOOST_FILESYSTEM_VERSION == 2) + return boost::filesystem::path(path).filename(); +#else return boost::filesystem::path(path).filename().string(); +#endif } string path_dirname(const string& path)