- Now CYGWIN has special handling for srand/srandom.
This commit is contained in:
Paul Beckingham 2010-10-25 00:49:42 -04:00
parent 488b23f42f
commit a5123dd2b7

View file

@ -27,7 +27,13 @@
#include <iostream> #include <iostream>
#include <stdlib.h> #include <stdlib.h>
#ifdef CYGWIN
#include <time.h> #include <time.h>
#else
#include <sys/time.h>
#endif
#include "Context.h" #include "Context.h"
#include "../auto.h" #include "../auto.h"
@ -36,10 +42,20 @@ Context context;
int main (int argc, char** argv) int main (int argc, char** argv)
{ {
// Set up randomness. // Set up randomness.
#ifdef HAVE_SRANDOM #ifdef CYGWIN
#ifdef HAVE_SRANDOM
srandom (time (NULL)); srandom (time (NULL));
#else #else
srand (time (NULL)); srand (time (NULL));
#endif
#else
#ifdef HAVE_SRANDOM
struct timeval tv;
gettimeofday (&tv, NULL);
srandom (tv.tv_usec);
#else
srand (tv.tv_usec);
#endif
#endif #endif
int status = 0; int status = 0;