Crossfire Server, Trunk  R20513
cf_random.c
Go to the documentation of this file.
1 #include <stdint.h>
2 #include <stdlib.h>
3 
4 #include "define.h"
5 
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 }
uint32_t cf_random()
Definition: cf_random.c:6
void cf_srandom(unsigned long seed)
Definition: cf_random.c:16
unsigned int uint32_t
Definition: win32.h:162
Core defines: object types, flags, etc.