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:
John "Elwin" Edwards 2014-05-03 10:31:30 -07:00
parent b9cc9cf3a7
commit 120beada5a
6 changed files with 104 additions and 66 deletions

View file

@ -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
}