From e195a31c0267a399a87bc3e536d4d12c8bdc8d02 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 6 May 2012 20:49:06 +1000 Subject: [PATCH] Fix win32 build. --- driver-icarus.c | 12 ------------ miner.h | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/driver-icarus.c b/driver-icarus.c index 47b0b164..dba66170 100644 --- a/driver-icarus.c +++ b/driver-icarus.c @@ -46,18 +46,6 @@ #else #include #include - - #ifndef timersub - #define timersub(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ - if ((result)->tv_usec < 0) { \ - --(result)->tv_sec; \ - (result)->tv_usec += 1000000; \ - } \ - } while (0) - #endif #endif #include "elist.h" diff --git a/miner.h b/miner.h index 0901d23f..186eb9f8 100644 --- a/miner.h +++ b/miner.h @@ -57,6 +57,33 @@ void *alloca (size_t); #endif #endif +#ifdef WIN32 + #ifndef timersub + #define timersub(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ + if ((result)->tv_usec < 0) { \ + --(result)->tv_sec; \ + (result)->tv_usec += 1000000; \ + } \ + } while (0) + #endif + #ifndef timeradd + # define timeradd(a, b, result) \ + do { \ + (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ + (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ + if ((result)->tv_usec >= 1000000) \ + { \ + ++(result)->tv_sec; \ + (result)->tv_usec -= 1000000; \ + } \ + } while (0) + #endif +#endif + + #ifdef HAVE_ADL #include "ADL_SDK/adl_sdk.h" #endif