Mercurial > hg > early-roguelike
comparison srogue/mdport.c @ 121:e6c8652473fe
srogue: more compatibility improvements.
Randomness now uses mdport, and xcrypt.c has been replaced with the
rogue5 version.
Super-Rogue now builds on MinGW.
author | John "Elwin" Edwards |
---|---|
date | Sat, 03 May 2014 10:31:30 -0700 |
parents | d6b7c3fb37ea |
children | 600873555ec0 |
comparison
equal
deleted
inserted
replaced
120:d6b7c3fb37ea | 121:e6c8652473fe |
---|---|
1565 #endif | 1565 #endif |
1566 #if defined (HAVE_SETGID) | 1566 #if defined (HAVE_SETGID) |
1567 setgid(playgid); | 1567 setgid(playgid); |
1568 #endif | 1568 #endif |
1569 } | 1569 } |
1570 | |
1571 int | |
1572 md_random(void) | |
1573 { | |
1574 #if defined (HAVE_LRAND48) | |
1575 return lrand48(); | |
1576 #elif defined (HAVE_RANDOM) | |
1577 return random(); | |
1578 #else | |
1579 return rand(); | |
1580 #endif | |
1581 } | |
1582 | |
1583 void | |
1584 md_srandom(unsigned int seed) | |
1585 { | |
1586 #if defined (HAVE_SRAND48) | |
1587 srand48(seed); | |
1588 #elif defined (HAVE_SRANDOM) | |
1589 srandom(seed); | |
1590 #else | |
1591 srand(seed); | |
1592 #endif | |
1593 } |