aboutsummaryrefslogtreecommitdiff
path: root/include/compat/time.h
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2019-01-06 13:20:29 -0600
committerBrent Cook <busterb@gmail.com>2019-01-06 15:47:55 -0600
commit7af3ba340d608860d519210032d190c26c6f6eae (patch)
tree60b1872ce6979728cccbb341afb0f4bc1cb8af24 /include/compat/time.h
parent779ec4dedcc62204a4d2acecb528a24931313a3d (diff)
downloadportable-7af3ba340d608860d519210032d190c26c6f6eae.tar.gz
portable-7af3ba340d608860d519210032d190c26c6f6eae.tar.bz2
portable-7af3ba340d608860d519210032d190c26c6f6eae.zip
add configure-time check for timespecsub
Diffstat (limited to 'include/compat/time.h')
-rw-r--r--include/compat/time.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/compat/time.h b/include/compat/time.h
index ccedba3..540807d 100644
--- a/include/compat/time.h
+++ b/include/compat/time.h
@@ -39,7 +39,11 @@ typedef int clockid_t;
39int clock_gettime(clockid_t clock_id, struct timespec *tp); 39int clock_gettime(clockid_t clock_id, struct timespec *tp);
40#endif 40#endif
41 41
42#ifndef timespecsub 42#ifdef timespecsub
43#define HAVE_TIMESPECSUB
44#endif
45
46#ifndef HAVE_TIMESPECSUB
43#define timespecsub(tsp, usp, vsp) \ 47#define timespecsub(tsp, usp, vsp) \
44 do { \ 48 do { \
45 (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ 49 (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
@@ -50,6 +54,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp);
50 } \ 54 } \
51 } while (0) 55 } while (0)
52#endif 56#endif
57
53#endif 58#endif
54 59
55#endif 60#endif