aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-03-07 03:06:17 +0100
committerDuncaen <mail@duncano.de>2017-03-07 03:06:17 +0100
commite4eae1edd832afb1dc17a205532d174c6f53bfe1 (patch)
tree5013c302fffc27c76975866c91413f8f5f12e0af
parentde01d68e73f56b51596accd70858fc87510dfa39 (diff)
downloadlobase-e4eae1edd832afb1dc17a205532d174c6f53bfe1.tar.gz
include/sys/time.h: define TIMEVAL_TO_TIMESPEC and TIMESPEC_TO_TIMEVAL conditionally
-rw-r--r--include/sys/time.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sys/time.h b/include/sys/time.h
index b59b27d..457eea6 100644
--- 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) \