Merge lp:~widelands-dev/widelands/bug1203121 into lp:widelands

Proposed by Jens Beyer
Status: Merged
Merged at revision: 6642
Proposed branch: lp:~widelands-dev/widelands/bug1203121
Merge into: lp:widelands
Diff against target: 15 lines (+2/-2)
1 file modified
src/helper.cc (+2/-2)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug1203121
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+175987@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Thanks for tracking this down jens! Lgtm.

review: Approve
Revision history for this message
SirVer (sirver) wrote :

I was in a merging mood, so I just merged this :).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/helper.cc'
2--- src/helper.cc 2013-07-19 07:55:34 +0000
3+++ src/helper.cc 2013-07-20 08:09:25 +0000
4@@ -79,9 +79,9 @@
5 ((k.sym >= SDLK_KP0) && (k.sym <= SDLK_KP_EQUALS));
6 }
7
8-static boost::random::mt19937 random_generator;
9+static boost::mt19937 random_generator;
10 string random_string(const string& chars, int nlen) {
11- boost::random::uniform_int_distribution<> index_dist(0, chars.size() - 1);
12+ boost::uniform_int<> index_dist(0, chars.size() - 1);
13 boost::scoped_array<char> buffer(new char[nlen - 1]);
14 for (int i = 0; i < nlen; ++i) {
15 buffer[i] = chars[index_dist(random_generator)];

Subscribers

People subscribed via source and target branches

to status/vote changes: