]> git.meshlink.io Git - utcp/blobdiff - utcp.c
Fix building without UTCP_DEBUG.
[utcp] / utcp.c
diff --git a/utcp.c b/utcp.c
index 6aa985f72701ee2eb0f6e4f1a3f9497cc6ddedd0..b5102dd7c907015ed7b87c5bd31844e462601e2d 100644 (file)
--- a/utcp.c
+++ b/utcp.c
 #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];