From 9fe586bcac581b3b2a2013a34907e1817b3f24bb Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 8 Jul 2023 22:49:39 -0700 Subject: til: add timersub macro for __WIN32__ just quick and nasty hacking to make win32 build again --- src/til.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 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) { -- cgit v1.2.3