widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #01311
[Merge] lp:~widelands-dev/widelands/bug1203121 into lp:widelands
Jens Beyer (Qcumber-some) has proposed merging lp:~widelands-dev/widelands/bug1203121 into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1203121 in widelands: "Latest trunk FTBFS on Ubuntu 12.04 (src/helper.cc:82:8: error: 'mt19937' in namespace 'boost::random' does not name a type)"
https://bugs.launchpad.net/widelands/+bug/1203121
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug1203121/+merge/175987
Fixes the build to run with boost 1.46
Problem is that boost::random::uniform_int_distribution<> and boost::random::mt19937 have been introduced with boost 1.47
But boost 1.46 defines boost::mt19937 and boost::random_int<> (which basically, on later boost versions, call the functions from boost::random namespace).
This branch compiles fine on Ubuntu 12.04 with boost 1.46, and on Gentoo with boost 1.49.
--
https://code.launchpad.net/~widelands-dev/widelands/bug1203121/+merge/175987
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug1203121 into lp:widelands.
=== modified file 'src/helper.cc'
--- src/helper.cc 2013-07-19 07:55:34 +0000
+++ src/helper.cc 2013-07-20 08:09:25 +0000
@@ -79,9 +79,9 @@
((k.sym >= SDLK_KP0) && (k.sym <= SDLK_KP_EQUALS));
}
-static boost::random::mt19937 random_generator;
+static boost::mt19937 random_generator;
string random_string(const string& chars, int nlen) {
- boost::random::uniform_int_distribution<> index_dist(0, chars.size() - 1);
+ boost::uniform_int<> index_dist(0, chars.size() - 1);
boost::scoped_array<char> buffer(new char[nlen - 1]);
for (int i = 0; i < nlen; ++i) {
buffer[i] = chars[index_dist(random_generator)];
Follow ups