From b3ca3aa12f8248c2d9e23f15a46e0f3c97397e54 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 22 Nov 1999 13:57:07 +1100 Subject: - Added OpenBSD bsd-strlcat.c, created bsd-strlcat.h - Added timersum() macro - Tidy RCSIDs of bsd-*.c --- acconfig.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'acconfig.h') diff --git a/acconfig.h b/acconfig.h index a37c0823c..db7fd18b1 100644 --- a/acconfig.h +++ b/acconfig.h @@ -71,6 +71,10 @@ # include /* For _PATH_XXX */ #endif +#ifdef HAVE_SYS_TIME_H +# include /* 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 -- cgit v1.2.3