From 310c36c86d95c5e12bae26000a9583a4a5276bf7 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Tue, 28 Dec 2021 15:06:33 +0000 Subject: [PATCH] Fix build on Alpine Linux Issue #144 Add `#define _POSIX_C_SOURCE 200809L` to avoid the error below: ../src/cursor.c: In function 'cursor_update_focus': ../src/cursor.c:271:2: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration] 271 | clock_gettime(CLOCK_MONOTONIC, &now); | ^~~~~~~~~~~~~ ../src/cursor.c:271:16: error: 'CLOCK_MONOTONIC' undeclared (first use in this function) 271 | clock_gettime(CLOCK_MONOTONIC, &now); | ^~~~~~~~~~~~~~~ ../src/cursor.c:271:16: note: each undeclared identifier is reported only once for each function it appears in ../src/cursor.c: In function 'is_double_click': ../src/cursor.c:486:16: error: 'CLOCK_MONOTONIC' undeclared (first use in this function) 486 | clock_gettime(CLOCK_MONOTONIC, &now); | ^~~~~~~~~~~~~~~ --- src/cursor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cursor.c b/src/cursor.c index e7a4a5d7..53de192b 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only +#define _POSIX_C_SOURCE 200809L #include #include #include