195 
/* Yikes...who would have thought finding a usable random() would be so much 
/* Yikes...who would have thought finding a usable random() would be so much 
196 
* trouble? 
* trouble? 
197 
* Note: random(), rand(), and lrand48() are *not* thread safe. 
* Note: random(), rand(), and lrand48() are *not* thread safe. 
198 

* 
199 

* QNX doesn't include random() and srandom() in libc.so, only in libc.a 
200 

* So we can only use these functions in static builds on QNX. 
201 
*/ 
*/ 
202 

#if defined QNX_HACKS && defined MAKING_MODS 
203 

# undef HAVE_RANDOM 
204 

# undef HAVE_SRANDOM 
205 

#endif 
206 


207 
#ifdef HAVE_RANDOM 
#ifdef HAVE_RANDOM 
208 
/* On systems with random(), RANDOM_MAX may or may not be defined. 
/* On systems with random(), RANDOM_MAX may or may not be defined. 
209 
* 
* 
252 
/* Use highorder bits for getting the random integer. With a modern 
/* Use highorder bits for getting the random integer. With a modern 
253 
* random() implmentation, modulo would probably be sufficient, but on 
* random() implmentation, modulo would probably be sufficient, but on 
254 
* systems lacking random(), it may just be a macro for an older rand() 
* systems lacking random(), it may just be a macro for an older rand() 
255 
* fucntion. 
* function. 
256 
*/ 
*/ 
257 
#define randint(n) (unsigned long) (random() / (RANDOM_MAX + 1.0) * n) 
#define randint(n) (unsigned long) (random() / (RANDOM_MAX + 1.0) * n) 
258 

