From a5123dd2b7328d4ada32fedd726c403da615688b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 25 Oct 2010 00:49:42 -0400 Subject: [PATCH] Bug - Now CYGWIN has special handling for srand/srandom. --- src/main.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1120fb8f9..5eee15123 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,7 +27,13 @@ #include #include + +#ifdef CYGWIN #include +#else +#include +#endif + #include "Context.h" #include "../auto.h" @@ -36,10 +42,20 @@ Context context; int main (int argc, char** argv) { // Set up randomness. -#ifdef HAVE_SRANDOM +#ifdef CYGWIN + #ifdef HAVE_SRANDOM srandom (time (NULL)); -#else + #else 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 int status = 0;