diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-22 13:57:07 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-22 13:57:07 +1100 |
commit | b3ca3aa12f8248c2d9e23f15a46e0f3c97397e54 (patch) | |
tree | 7833695d2f077b965b02a5b9927be50456d172d7 /acconfig.h | |
parent | a75cb9666237b3479471238eb26b39872b9858e0 (diff) |
- Added OpenBSD bsd-strlcat.c, created bsd-strlcat.h
- Added timersum() macro
- Tidy RCSIDs of bsd-*.c
Diffstat (limited to 'acconfig.h')
-rw-r--r-- | acconfig.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -71,6 +71,10 @@ # include <paths.h> /* For _PATH_XXX */ #endif +#ifdef HAVE_SYS_TIME_H +# include <sys/time.h> /* For timersub */ +#endif + #ifndef SHUT_RDWR enum { @@ -178,3 +182,16 @@ enum # define MAX(a,b) (((a)>(b))?(a):(b)) # define MIN(a,b) (((a)<(b))?(a):(b)) #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 |