srogue: more compatibility improvements.
Randomness now uses mdport, and xcrypt.c has been replaced with the rogue5 version. Super-Rogue now builds on MinGW.
This commit is contained in:
parent
b9cc9cf3a7
commit
120beada5a
6 changed files with 104 additions and 66 deletions
|
|
@ -1567,3 +1567,27 @@ md_resetpriv(void)
|
|||
setgid(playgid);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
md_random(void)
|
||||
{
|
||||
#if defined (HAVE_LRAND48)
|
||||
return lrand48();
|
||||
#elif defined (HAVE_RANDOM)
|
||||
return random();
|
||||
#else
|
||||
return rand();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
md_srandom(unsigned int seed)
|
||||
{
|
||||
#if defined (HAVE_SRAND48)
|
||||
srand48(seed);
|
||||
#elif defined (HAVE_SRANDOM)
|
||||
srandom(seed);
|
||||
#else
|
||||
srand(seed);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue