Crossfire Server, Trunk
cf_random.c
Go to the documentation of this file.
1 #include <stdint.h>
2 #include <stdlib.h>
3 
4 #include "define.h"
5 
6 uint32_t cf_random(void) {
7 #if defined(HAVE_SRANDOM)
8  return random();
9 #elif defined(HAVE_SRAND48)
10  return lrand48();
11 #else
12  return rand();
13 #endif
14 }
15 
16 void cf_srandom(unsigned long seed) {
17 #if defined(HAVE_SRANDOM)
18  srandom(seed);
19 #elif defined(HAVE_SRAND48)
20  srand48(seed);
21 #else
22  srand(seed);
23 #endif
24 }
cf_srandom
void cf_srandom(unsigned long seed)
Definition: cf_random.c:16
cf_random
uint32_t cf_random(void)
Definition: cf_random.c:6
define.h