]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Fix build on Alpine Linux
authorJohan Malm <jgm323@gmail.com>
Tue, 28 Dec 2021 15:06:33 +0000 (15:06 +0000)
committerJohan Malm <jgm323@gmail.com>
Tue, 28 Dec 2021 15:06:33 +0000 (15:06 +0000)
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

index e7a4a5d7a34f39a42bf97e00346126b0c802c102..53de192bf52e1cc8c2d0c441b250e28e3930bca7 100644 (file)
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
+#define _POSIX_C_SOURCE 200809L
 #include <assert.h>
 #include <linux/input-event-codes.h>
 #include <sys/time.h>