mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
Bug
- Now CYGWIN has special handling for srand/srandom.
This commit is contained in:
parent
488b23f42f
commit
a5123dd2b7
1 changed files with 18 additions and 2 deletions
20
src/main.cpp
20
src/main.cpp
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue