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
diff --git a/acconfig.h b/acconfig.h index a37c0823c..db7fd18b1 100644 --- a/acconfig.h +++ b/acconfig.h | |||
@@ -71,6 +71,10 @@ | |||
71 | # include <paths.h> /* For _PATH_XXX */ | 71 | # include <paths.h> /* For _PATH_XXX */ |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | #ifdef HAVE_SYS_TIME_H | ||
75 | # include <sys/time.h> /* For timersub */ | ||
76 | #endif | ||
77 | |||
74 | #ifndef SHUT_RDWR | 78 | #ifndef SHUT_RDWR |
75 | enum | 79 | enum |
76 | { | 80 | { |
@@ -178,3 +182,16 @@ enum | |||
178 | # define MAX(a,b) (((a)>(b))?(a):(b)) | 182 | # define MAX(a,b) (((a)>(b))?(a):(b)) |
179 | # define MIN(a,b) (((a)<(b))?(a):(b)) | 183 | # define MIN(a,b) (((a)<(b))?(a):(b)) |
180 | #endif | 184 | #endif |
185 | |||
186 | #ifndef timersub | ||
187 | #define timersub(a, b, result) \ | ||
188 | do { \ | ||
189 | (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ | ||
190 | (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ | ||
191 | if ((result)->tv_usec < 0) { \ | ||
192 | --(result)->tv_sec; \ | ||
193 | (result)->tv_usec += 1000000; \ | ||
194 | } \ | ||
195 | } while (0) | ||
196 | |||
197 | #endif | ||