Browse Source

- Compile fixes

beegee1 13 years ago
parent
commit
6d0221c0e7
2 changed files with 13 additions and 1 deletions
  1. 12 0
      lib/CRandomGenerator.h
  2. 1 1
      lib/Mapping/CMapEditManager.cpp

+ 12 - 0
lib/CRandomGenerator.h

@@ -11,14 +11,26 @@
 
 #pragma once
 
+#include <boost/version.hpp>
 #include <boost/random/mersenne_twister.hpp>
+
+#if BOOST_VERSION >= 104700
 #include <boost/random/uniform_int_distribution.hpp>
 #include <boost/random/uniform_real_distribution.hpp>
+#else
+#include <boost/random/uniform_int.hpp>
+#include <boost/random/uniform_real.hpp>
+#endif
 #include <boost/random/variate_generator.hpp>
 
 typedef boost::mt19937 TGenerator;
+#if BOOST_VERSION >= 104700
 typedef boost::random::uniform_int_distribution<int> TIntDist;
 typedef boost::random::uniform_real_distribution<double> TRealDist;
+#else
+typedef boost::uniform_int<int> TIntDist;
+typedef boost::uniform_real<double> TRealDist;
+#endif
 typedef boost::variate_generator<TGenerator &, TIntDist> TRandI;
 typedef boost::variate_generator<TGenerator &, TRealDist> TRand;
 

+ 1 - 1
lib/Mapping/CMapEditManager.cpp

@@ -258,7 +258,7 @@ CMapEditManager::ValidationResult CMapEditManager::validateTerrainView(int posx,
 			const std::pair<std::string, int> & rulePair = pattern.data[i][j];
 			const std::string & rule = rulePair.first;
 			bool isNative = (rule == TerrainViewPattern::RULE_NATIVE || rule == TerrainViewPattern::RULE_ANY) && !isAlien;
-			auto validationRslt = [&](bool rslt)
+			auto validationRslt = [&](bool rslt) -> bool
 			{
 				if(rslt)
 				{