timersub macro needed for timing in iofunc.c for win32

Hamlib-1.2.15
Stephane Fillod 2011-12-12 09:40:43 +01:00
rodzic 8718881013
commit 084aaef2a5
1 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -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