[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49225] trunk/blender/intern/cycles/util: Make Cycles compatible with older boost versions.

Sergey Sharybin sergey.vfx at gmail.com
Wed Jul 25 22:25:47 CEST 2012


Revision: 49225
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49225
Author:   nazgul
Date:     2012-07-25 20:25:47 +0000 (Wed, 25 Jul 2012)
Log Message:
-----------
Make Cycles compatible with older boost versions.

Patch by IRIE Shinsuke, thanks!

Modified Paths:
--------------
    trunk/blender/intern/cycles/util/util_cache.cpp
    trunk/blender/intern/cycles/util/util_path.cpp

Modified: trunk/blender/intern/cycles/util/util_cache.cpp
===================================================================
--- trunk/blender/intern/cycles/util/util_cache.cpp	2012-07-25 20:17:38 UTC (rev 49224)
+++ trunk/blender/intern/cycles/util/util_cache.cpp	2012-07-25 20:25:47 UTC (rev 49225)
@@ -26,6 +26,10 @@
 #include "util_path.h"
 #include "util_types.h"
 
+#if (BOOST_VERSION < 104400)
+#  define BOOST_FILESYSTEM_VERSION 2
+#endif
+
 #include <boost/filesystem.hpp> 
 #include <boost/algorithm/string.hpp>
 
@@ -115,7 +119,11 @@
 		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())

Modified: trunk/blender/intern/cycles/util/util_path.cpp
===================================================================
--- trunk/blender/intern/cycles/util/util_path.cpp	2012-07-25 20:17:38 UTC (rev 49224)
+++ trunk/blender/intern/cycles/util/util_path.cpp	2012-07-25 20:25:47 UTC (rev 49225)
@@ -26,6 +26,10 @@
 
 #include <stdio.h>
 
+#if (BOOST_VERSION < 104400)
+#  define BOOST_FILESYSTEM_VERSION 2
+#endif
+
 #include <boost/filesystem.hpp> 
 #include <boost/algorithm/string.hpp>
 
@@ -58,7 +62,11 @@
 
 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)




More information about the Bf-blender-cvs mailing list