Got ride of more legacy compatibility code.
This commit is contained in:
parent
2190c254f8
commit
a8114d6677
@ -2354,21 +2354,18 @@ void lamexp_seed_rand(void)
|
|||||||
*/
|
*/
|
||||||
unsigned int lamexp_rand(void)
|
unsigned int lamexp_rand(void)
|
||||||
{
|
{
|
||||||
unsigned int rnd = 0;
|
quint32 rnd = 0;
|
||||||
if(const lamexp_os_version_t* osVer = lamexp_get_os_version())
|
|
||||||
|
if(rand_s(&rnd) == 0)
|
||||||
{
|
{
|
||||||
if(LAMEXP_MIN_OS_VER(osVer, 5, 1))
|
return rnd;
|
||||||
{
|
|
||||||
if(rand_s(&rnd) == 0)
|
|
||||||
{
|
|
||||||
return rnd;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(size_t i = 0; i < sizeof(unsigned int); i++)
|
for(size_t i = 0; i < sizeof(unsigned int); i++)
|
||||||
{
|
{
|
||||||
rnd = (rnd << 8) ^ qrand();
|
rnd = (rnd << 8) ^ qrand();
|
||||||
}
|
}
|
||||||
|
|
||||||
return rnd;
|
return rnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user