diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-07-08 22:49:39 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-07-08 22:49:39 -0700 |
commit | 9fe586bcac581b3b2a2013a34907e1817b3f24bb (patch) | |
tree | 67de6be7d0e1c541cd650a3dfec8fd80fbcbda27 | |
parent | 8132787168fa57da870edfb816589588d4620e1b (diff) |
til: add timersub macro for __WIN32__
just quick and nasty hacking to make win32 build again
-rw-r--r-- | src/til.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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) { |