summaryrefslogtreecommitdiff
path: root/tests/misc.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-11-13 22:05:24 +0100
committerKevin Ryde <user42@zip.com.au>2001-11-13 22:05:24 +0100
commitf2f9810e4005a46af4c80a95642aad73c31c0451 (patch)
treebc5c617a0c5cb5397f86df90d4080b1fe1b95a4f /tests/misc.c
parent9634965957ef9b0c13eeff5fcde65ce64e740816 (diff)
downloadgmp-f2f9810e4005a46af4c80a95642aad73c31c0451.tar.gz
* tests/misc.c (tests_rand_end): Use time() if gettimeofday() not
available (eg. mingw).
Diffstat (limited to 'tests/misc.c')
-rw-r--r--tests/misc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/misc.c b/tests/misc.c
index 164b2f609..872934ca5 100644
--- a/tests/misc.c
+++ b/tests/misc.c
@@ -87,12 +87,13 @@ tests_rand_start (void)
struct timeval tv;
gettimeofday (&tv, NULL);
seed = tv.tv_sec + tv.tv_usec;
- gmp_randseed_ui (rands, seed);
- printf ("Seed GMP_CHECK_RANDOMIZE=%lu (include this in bug reports)\n", seed);
#else
- printf ("tests_rand_start(): Oops, gettimeofday() not available\n");
- abort ();
+ time_t tv;
+ time (&tv);
+ seed = tv;
#endif
+ gmp_randseed_ui (rands, seed);
+ printf ("Seed GMP_CHECK_RANDOMIZE=%lu (include this in bug reports)\n", seed);
}
}
}