X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fdropin.h;h=61143eb83c89d6ca251fd817da4ebbd9d49eba91;hb=58026f72a17b316f1b9756400f0ee9e9f519f877;hp=a3a22e3fa0cd56feeee3733246a71b8c1230254c;hpb=79e9a4f743b7b59fed968575f6b36171cf4a0063;p=tinc diff --git a/src/dropin.h b/src/dropin.h index a3a22e3f..61143eb8 100644 --- a/src/dropin.h +++ b/src/dropin.h @@ -41,4 +41,26 @@ extern int vasprintf(char **, const char *, va_list ap); extern int gettimeofday(struct timeval *, void *); #endif -#endif /* __DROPIN_H__ */ +#ifndef HAVE_USLEEP +extern int usleep(long long usec); +#endif + +#ifndef timeradd +#define timeradd(a, b, r) do {\ + (r)->tv_sec = (a)->tv_sec + (b)->tv_sec;\ + (r)->tv_usec = (a)->tv_usec + (b)->tv_usec;\ + if((r)->tv_usec >= 1000000)\ + (r)->tv_sec++, (r)->tv_usec -= 1000000;\ +} while (0) +#endif + +#ifndef timersub +#define timersub(a, b, r) do {\ + (r)->tv_sec = (a)->tv_sec - (b)->tv_sec;\ + (r)->tv_usec = (a)->tv_usec - (b)->tv_usec;\ + if((r)->tv_usec < 1000000)\ + (r)->tv_sec--, (r)->tv_usec += 1000000;\ +} while (0) +#endif + +#endif /* __DROPIN_H__ */