X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fdropin.h;h=abac29094ef1f5360183fe0c89182d1f8618e55e;hb=fb1e69072e9c1dda35033cc2785c27e324a2abda;hp=3617b70e2b172083c83df9bf44213db3b2560a90;hpb=268c8545aaf83b7433f43402f5c77e39e20006ef;p=tinc diff --git a/src/dropin.h b/src/dropin.h index 3617b70e..abac2909 100644 --- a/src/dropin.h +++ b/src/dropin.h @@ -45,4 +45,29 @@ extern int gettimeofday(struct timeval *, void *); extern int usleep(long long usec); #endif -#endif /* __DROPIN_H__ */ +#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 < 0)\ + (r)->tv_sec--, (r)->tv_usec += 1000000;\ +} while (0) +#endif + +#ifdef HAVE_MINGW +#define mkdir(a, b) mkdir(a) +#ifndef SHUT_RDWR +#define SHUT_RDWR SD_BOTH +#endif +#endif + +#endif /* __DROPIN_H__ */