forked from Vhex-Kernel-Core/fxlibc
stdlib: automatically seed PRNG with srand(1)
This commit is contained in:
parent
7eb2a6e8ab
commit
74b805e8b5
|
@ -12,3 +12,9 @@ int rand(void)
|
|||
{
|
||||
return tinymt32_generate_uint32(&random) & 0x7fffffff;
|
||||
}
|
||||
|
||||
__attribute__((constructor))
|
||||
static void init_prng(void)
|
||||
{
|
||||
srand(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue