add configure-time check for timespecsub

This commit is contained in:
Brent Cook
2019-01-06 13:20:29 -06:00
parent 779ec4dedc
commit 7af3ba340d
3 changed files with 13 additions and 2 deletions

View File

@@ -39,7 +39,11 @@ typedef int clockid_t;
int clock_gettime(clockid_t clock_id, struct timespec *tp);
#endif
#ifndef timespecsub
#ifdef timespecsub
#define HAVE_TIMESPECSUB
#endif
#ifndef HAVE_TIMESPECSUB
#define timespecsub(tsp, usp, vsp) \
do { \
(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
@@ -50,6 +54,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp);
} \
} while (0)
#endif
#endif
#endif