mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 01:47:13 +00:00
simplify preprocessor code in seed_rng.cpp
This commit is contained in:
parent
098d886db9
commit
cf665ffbf2
@ -49,16 +49,14 @@
|
|||||||
|
|
||||||
namespace seed_rng {
|
namespace seed_rng {
|
||||||
|
|
||||||
#ifdef SEED_RNG_USE_BOOST_RANDOM_DEVICE
|
|
||||||
uint32_t next_seed() {
|
uint32_t next_seed() {
|
||||||
|
#ifdef SEED_RNG_USE_BOOST_RANDOM_DEVICE
|
||||||
static boost::random_device rnd_;
|
static boost::random_device rnd_;
|
||||||
return rnd_();
|
return rnd_();
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
uint32_t next_seed() {
|
|
||||||
return static_cast<uint32_t> (std::time(0));
|
return static_cast<uint32_t> (std::time(0));
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
std::string next_seed_str() {
|
std::string next_seed_str() {
|
||||||
uint32_t random_seed_ = next_seed();
|
uint32_t random_seed_ = next_seed();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user