diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-10-27 09:25:36 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-10-27 09:25:36 +0200 |
commit | e1411f865fcd0f40dc1703cf939373e8c1c5fc83 (patch) | |
tree | 35f563cd8f76944a297843b34615f03b05008e55 | |
parent | 8c818a6ba140fe45b7119a934c826f32d8de7256 (diff) | |
download | gnutls-e1411f865fcd0f40dc1703cf939373e8c1c5fc83.tar.gz |
win32 fixes by David Hoyt.
-rw-r--r-- | src/benchmark.c | 7 | ||||
-rw-r--r-- | src/benchmark.h | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/benchmark.c b/src/benchmark.c index 229f24b2e9..42f821c473 100644 --- a/src/benchmark.c +++ b/src/benchmark.c @@ -83,7 +83,9 @@ value2human (unsigned long bytes, double time, double *data, double *speed, void start_benchmark(struct benchmark_st * st) { memset(st, 0, sizeof(*st)); +#ifndef _WIN32 st->old_handler = signal (SIGALRM, alarm_handler); +#endif gettime (&st->start); benchmark_must_finish = 0; @@ -100,13 +102,12 @@ void start_benchmark(struct benchmark_st * st) fprintf (stderr, "error: CreateThread %u\n", GetLastError ()); exit(1); } - alarm_timeout.QuadPart = (5) * 10000000; - if (SetWaitableTimer (st->wtimer, &alarm_timeout, 0, NULL, NULL, FALSE) == 0) + st->alarm_timeout.QuadPart = (5) * 10000000; + if (SetWaitableTimer (st->wtimer, &st->alarm_timeout, 0, NULL, NULL, FALSE) == 0) { fprintf (stderr, "error: SetWaitableTimer %u\n", GetLastError ()); exit(1); } - } #else alarm (5); #endif diff --git a/src/benchmark.h b/src/benchmark.h index 0bf172e0ba..4f916a801e 100644 --- a/src/benchmark.h +++ b/src/benchmark.h @@ -1,6 +1,9 @@ #include <sys/time.h> #include <time.h> #include <signal.h> +#if defined(_WIN32) +# include <windows.h> +#endif #include "timespec.h" /* gnulib gettime */ typedef void (*sighandler_t)(int); |