Add fallback for random number generator

`getrandom()` is available since Linux 3.17 (2014/10/05) yet there are older devices that don't
meet this requirement.

Closes #22691.
PR #22723.
This commit is contained in:
Chocobo1
2025-05-18 15:37:17 +08:00
committed by Vladimir Golovnev (Glassez)
parent 9133b16431
commit f51ad39ad9
4 changed files with 49 additions and 8 deletions

View File

@@ -42,7 +42,7 @@
uint32_t Utils::Random::rand(const uint32_t min, const uint32_t max)
{
static RandomLayer layer;
static const RandomLayer layer;
// new distribution is cheap: https://stackoverflow.com/a/19036349
std::uniform_int_distribution<uint32_t> uniform(min, max);