[Live-devel] inet.c random change

David Skiba skiba at avaya.com
Fri Jan 28 12:17:19 PST 2005


Ross,

 

May I suggest the following code change. I wanted to use the 

Windows functions for random because of the threading issues

previously reported. The random functions under Windows are

different. Here is the change I made in my local copy and would

like to have this available in the maintained source.

 

.Thanks, Dave

 

#ifdef USE_SYSTEM_RANDOM

#include <stdlib.h>

long our_random() {

#if defined(__WIN32__) || defined(_WIN32)

  return rand();

#else

            return random();

#endif

}

void our_srandom(unsigned int x) {

#if defined(__WIN32__) || defined(_WIN32)

  return srand(x);

#else

  return srandom(x);

#endif

}

#else

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live.com/pipermail/live-devel/attachments/20050128/d275c054/attachment-0001.html


More information about the live-devel mailing list