From: <den...@us...> - 2010-06-27 12:59:47
|
Revision: 196 http://stdair.svn.sourceforge.net/stdair/?rev=196&view=rev Author: denis_arnaud Date: 2010-06-27 12:59:39 +0000 (Sun, 27 Jun 2010) Log Message: ----------- [Dev] Added pragma directives to support Boost versions lower than 1.35 (e.g., for RedHat/CentOS 5). Modified Paths: -------------- trunk/stdair/stdair/basic/BasFileMgr.cpp trunk/stdair/stdair/basic/RandomGeneration.cpp Modified: trunk/stdair/stdair/basic/BasFileMgr.cpp =================================================================== --- trunk/stdair/stdair/basic/BasFileMgr.cpp 2010-06-13 14:07:35 UTC (rev 195) +++ trunk/stdair/stdair/basic/BasFileMgr.cpp 2010-06-27 12:59:39 UTC (rev 196) @@ -5,7 +5,13 @@ #include <cassert> // Boost (STL Extension) // Boost Filesystem (http://www.boost.org/doc/libs/1_41_0/libs/filesystem/doc/index.htm) +#include <boost/version.hpp> +#if BOOST_VERSION >= 103500 #include <boost/filesystem.hpp> +#else +#include <boost/filesystem/path.hpp> +#include <boost/filesystem/operations.hpp> +#endif // StdAir #include <stdair/basic/BasFileMgr.hpp> @@ -19,11 +25,17 @@ boostfs::path lPath (iFilepath); - if (boostfs::exists (lPath) == true && boostfs::is_regular (lPath) == true) { + if (boostfs::exists (lPath) == false) { + return oFine; + } + +#if BOOST_VERSION >= 103500 + if (boostfs::is_regular (lPath) == true) { oFine = true; } +#endif - return true; + return oFine; } } Modified: trunk/stdair/stdair/basic/RandomGeneration.cpp =================================================================== --- trunk/stdair/stdair/basic/RandomGeneration.cpp 2010-06-13 14:07:35 UTC (rev 195) +++ trunk/stdair/stdair/basic/RandomGeneration.cpp 2010-06-27 12:59:39 UTC (rev 196) @@ -2,7 +2,10 @@ #include <cassert> #include <iostream> // Boost +#include <boost/version.hpp> +#if BOOST_VERSION >= 103500 #include <boost/math/distributions/normal.hpp> +#endif // BOOST_VERSION >= 103500 //STDAIR #include <stdair/basic/RandomGeneration.hpp> @@ -54,10 +57,15 @@ // ////////////////////////////////////////////////////////////////////// RealNumber_T RandomGeneration:: generateNormal (const RealNumber_T& mu, const RealNumber_T& sigma) { +#if BOOST_VERSION >= 103500 const Probability_T lVariateUnif = generateUniform01 (); const boost::math::normal lNormal (mu, sigma); const RealNumber_T lRealNumberOfRequestsToBeGenerated = boost::math::quantile(lNormal, lVariateUnif); +#else // BOOST_VERSION >= 103500 + // TODO: rely on GSL when Boost version smaller than 1.35 + const RealNumber_T lRealNumberOfRequestsToBeGenerated = 0.0; +#endif // BOOST_VERSION >= 103500 return lRealNumberOfRequestsToBeGenerated; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |