lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit e4eae1edd832afb1dc17a205532d174c6f53bfe1
parent de01d68e73f56b51596accd70858fc87510dfa39
Author: Duncaen <mail@duncano.de>
Date:   Tue,  7 Mar 2017 03:06:17 +0100

include/sys/time.h: define TIMEVAL_TO_TIMESPEC and TIMESPEC_TO_TIMEVAL conditionally

Diffstat:
include/sys/time.h | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/sys/time.h b/include/sys/time.h @@ -4,14 +4,20 @@ #define _COMPAT_SYS_TIME_H_ #include <time.h> +#ifndef TIMEVAL_TO_TIMESPEC #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ (ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ } +#endif + +#ifndef TIMESPEC_TO_TIMEVAL #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ (tv)->tv_sec = (ts)->tv_sec; \ (tv)->tv_usec = (ts)->tv_nsec / 1000; \ } +#endif + #define timespecclear(tsp) (tsp)->tv_sec = (tsp)->tv_nsec = 0 #define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec) #define timespeccmp(tsp, usp, cmp) \