From: Guus Sliepen Date: Sun, 29 Mar 2020 15:10:24 +0000 (+0200) Subject: Fix building without UTCP_DEBUG. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=3c7a825eb4582146108ed26cd69e2573a86f709f;p=utcp Fix building without UTCP_DEBUG. --- 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];