summaryrefslogtreecommitdiffstats
path: root/acconfig.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-22 13:57:07 +1100
committerDamien Miller <djm@mindrot.org>1999-11-22 13:57:07 +1100
commitb3ca3aa12f8248c2d9e23f15a46e0f3c97397e54 (patch)
tree7833695d2f077b965b02a5b9927be50456d172d7 /acconfig.h
parenta75cb9666237b3479471238eb26b39872b9858e0 (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.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/acconfig.h b/acconfig.h
index a37c0823..db7fd18b 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -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