From 3c7a825eb4582146108ed26cd69e2573a86f709f Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 29 Mar 2020 17:10:24 +0200 Subject: [PATCH] Fix building without UTCP_DEBUG. --- utcp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/utcp.c b/utcp.c index 6aa985f..b5102dd 100644 --- a/utcp.c +++ b/utcp.c @@ -43,6 +43,14 @@ #undef poll #endif +#ifndef UTCP_CLOCK +#if defined(CLOCK_MONOTONIC_RAW) && defined(__x86_64__) +#define UTCP_CLOCK CLOCK_MONOTONIC_RAW +#else +#define UTCP_CLOCK CLOCK_MONOTONIC +#endif +#endif + static void timespec_sub(const struct timespec *a, const struct timespec *b, struct timespec *r) { r->tv_sec = a->tv_sec - b->tv_sec; r->tv_nsec = a->tv_nsec - b->tv_nsec; @@ -90,14 +98,6 @@ static inline size_t max(size_t a, size_t b) { #define UTCP_DEBUG_DATALEN 20 #endif -#ifndef UTCP_CLOCK -#if defined(CLOCK_MONOTONIC_RAW) && defined(__x86_64__) -#define UTCP_CLOCK CLOCK_MONOTONIC_RAW -#else -#define UTCP_CLOCK CLOCK_MONOTONIC -#endif -#endif - static void debug(struct utcp_connection *c, const char *format, ...) { struct timespec tv; char buf[1024]; -- 2.39.5