summaryrefslogtreecommitdiff
path: root/acconfig.h
diff options
context:
space:
mode:
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 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
75enum 79enum
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