summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/til.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/til.c b/src/til.c
index c8133ef..d343d2a 100644
--- a/src/til.c
+++ b/src/til.c
@@ -112,6 +112,19 @@ void til_shutdown(void)
}
+#ifdef __WIN32__
+/* taken from glibc <sys/time.h> just to make windows happy*/
+# 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
+
/* returns number of "ticks" since til_init(), which are currently milliseconds */
unsigned til_ticks_now(void)
{
© All Rights Reserved