aboutsummaryrefslogtreecommitdiff
path: root/src/xz/mytime.c
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2022-12-29 01:55:19 +0800
committerJia Tan <jiat0218@gmail.com>2023-01-05 00:27:51 +0800
commitc410d812ea12bfc74f6b727c1a799478c79f19ca (patch)
tree000e60906f3b07fac46212e6c68680e0081b3d61 /src/xz/mytime.c
parentliblzma: Includes sys/time.h conditionally in mythread (diff)
downloadxz-c410d812ea12bfc74f6b727c1a799478c79f19ca.tar.xz
xz: Includes <time.h> and <sys/time.h> conditionally in mytime.c.
Previously, mytime.c depended on mythread.h for <time.h> to be included.
Diffstat (limited to 'src/xz/mytime.c')
-rw-r--r--src/xz/mytime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xz/mytime.c b/src/xz/mytime.c
index a81c88af..7e8a0749 100644
--- a/src/xz/mytime.c
+++ b/src/xz/mytime.c
@@ -12,7 +12,9 @@
#include "private.h"
-#if !(defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC))
+#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC)
+# include <time.h>
+#else
# include <sys/time.h>
#endif