Commit 7b4ccb5f authored by Francois Keith's avatar Francois Keith Committed by Florent Lamiraux florent@laas.fr
Browse files

Compatibility with boost>1.46.1

Correct issues with filesystem.
parent 89f2018a
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <sot/core/debug.hh> #include <sot/core/debug.hh>
#include <sot-dynamic/dynamic.h> #include <sot-dynamic/dynamic.h>
#include <boost/version.hpp>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/format.hpp> #include <boost/format.hpp>
...@@ -494,7 +495,9 @@ setXmlRankFile( const std::string& filename ) ...@@ -494,7 +495,9 @@ setXmlRankFile( const std::string& filename )
// Helper macro for Dynamic::parseConfigFiles(). // Helper macro for Dynamic::parseConfigFiles().
// Check that all required files exist or throw an exception // Check that all required files exist or throw an exception
// otherwise. // otherwise.
#define CHECK_FILE(PATH, FILE_DESCRIPTION) \ #if BOOST_VERSION < 104601
# define CHECK_FILE(PATH, FILE_DESCRIPTION) \
do \ do \
{ \ { \
if (!boost::filesystem::exists (PATH) \ if (!boost::filesystem::exists (PATH) \
...@@ -510,6 +513,26 @@ setXmlRankFile( const std::string& filename ) ...@@ -510,6 +513,26 @@ setXmlRankFile( const std::string& filename )
} \ } \
while (0) while (0)
#else
# define CHECK_FILE(PATH, FILE_DESCRIPTION) \
do \
{ \
if (!boost::filesystem::exists (PATH) \
|| boost::filesystem::is_directory (PATH)) \
{ \
boost::format fmt ("Failed to open the %s (%s)."); \
fmt % (FILE_DESCRIPTION) % robotModelPath.string (); \
\
SOT_THROW ExceptionDynamic \
(ExceptionDynamic::DYNAMIC_JRL, \
fmt.str ()); \
} \
} \
while (0)
#endif // BOOST_VERSION < 104600
void Dynamic::parseConfigFiles() void Dynamic::parseConfigFiles()
{ {
sotDEBUGIN(15); sotDEBUGIN(15);
...@@ -528,10 +551,15 @@ void Dynamic::parseConfigFiles() ...@@ -528,10 +551,15 @@ void Dynamic::parseConfigFiles()
try try
{ {
sotDEBUG(35) << "Parse the vrml."<<endl; sotDEBUG(35) << "Parse the vrml."<<endl;
#if BOOST_VERSION < 104600
std::string robotModelPathStr (robotModelPath.file_string()); std::string robotModelPathStr (robotModelPath.file_string());
std::string xmlRankPathStr (xmlRankPath.file_string()); std::string xmlRankPathStr (xmlRankPath.file_string());
std::string xmlSpecificityPathStr (xmlSpecificityPath.file_string()); std::string xmlSpecificityPathStr (xmlSpecificityPath.file_string());
#else
std::string robotModelPathStr (robotModelPath.string());
std::string xmlRankPathStr (xmlRankPath.string());
std::string xmlSpecificityPathStr (xmlSpecificityPath.string());
#endif //BOOST_VERSION < 104600
djj::parseOpenHRPVRMLFile (*m_HDR, djj::parseOpenHRPVRMLFile (*m_HDR,
robotModelPathStr, robotModelPathStr,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment