From 74dae7d30091e906d6a92a57952dea4354473f9b Mon Sep 17 00:00:00 2001 From: Jia Tan Date: Thu, 29 Dec 2022 01:10:53 +0800 Subject: Build: No longer require HAVE_DECL_CLOCK_MONOTONIC to always be set. Previously, if threading was enabled HAVE_DECL_CLOCK_MONOTONIC would always be set to 0 or 1. However, this macro was needed in xz so if xz was not built with threading and HAVE_DECL_CLOCK_MONOTONIC was not defined but HAVE_CLOCK_GETTIME was, it caused a warning during build. Now, HAVE_DECL_CLOCK_MONOTONIC has been renamed to HAVE_CLOCK_MONOTONIC and will only be set if it is 1. --- src/common/mythread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/mythread.h b/src/common/mythread.h index 41382183..9be90d4e 100644 --- a/src/common/mythread.h +++ b/src/common/mythread.h @@ -219,8 +219,8 @@ static inline int mythread_cond_init(mythread_cond *mycond) { #ifdef HAVE_CLOCK_GETTIME - // NOTE: HAVE_DECL_CLOCK_MONOTONIC is always defined to 0 or 1. -# if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && HAVE_DECL_CLOCK_MONOTONIC +# if defined(HAVE_PTHREAD_CONDATTR_SETCLOCK) && \ + defined(HAVE_CLOCK_MONOTONIC) struct timespec ts; pthread_condattr_t condattr; -- cgit v1.2.3