1
1
forked from 0ad/0ad

Windows build fixes

This was SVN commit r7566.
This commit is contained in:
Ykkrosh 2010-05-22 14:27:53 +00:00
parent 94e5d88169
commit f902803af2
2 changed files with 3 additions and 5 deletions

View File

@ -31,7 +31,6 @@
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/variate_generator.hpp>
#include "valgrind.h"
@ -125,8 +124,7 @@ JSBool Math_random(JSContext* cx, uintN UNUSED(argc), jsval* vp)
// TODO: is the double generation sufficiently deterministic for us?
boost::uniform_real<double> dist;
boost::variate_generator<boost::rand48&, boost::uniform_real<> > gen(*rng, dist);
double r = gen();
double r = dist(*rng);
jsval rv;
if (!JS_NewNumberValue(cx, r, &rv))

View File

@ -117,11 +117,11 @@ public:
boost::rand48 rng;
script.ReplaceNondeterministicFunctions(rng);
rng.seed(0);
rng.seed((u64)0);
TS_ASSERT(script.Eval("Math.random()", d1));
TS_ASSERT(script.Eval("Math.random()", d2));
TS_ASSERT_DIFFERS(d1, d2);
rng.seed(0);
rng.seed((u64)0);
TS_ASSERT(script.Eval("Math.random()", d2));
TS_ASSERT_EQUALS(d1, d2);
}