diff --git a/macros/gr_pwin32.m4 b/macros/gr_pwin32.m4 index dcf7fb884..c566cfe9f 100644 --- a/macros/gr_pwin32.m4 +++ b/macros/gr_pwin32.m4 @@ -104,6 +104,18 @@ struct timezone { int gettimeofday(struct timeval *tv, struct timezone *tz); #endif +#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 HAVE_SSIZE_T typedef size_t ssize_t; #endif