Skip to content
Snippets Groups Projects
Commit b359cd2c authored by Jan Beich's avatar Jan Beich Committed by Simon Ser
Browse files

wayland-info: disable Linux-only clocks if not available


Previously, building on DragonFly, FreeBSD, NetBSD, OpenBSD failed with:
wayland-info/wayland-info.c:1783:4: error: use of undeclared identifier 'CLOCK_MONOTONIC_RAW'
             [CLOCK_MONOTONIC_RAW] = "CLOCK_MONOTONIC_RAW",
              ^
wayland-info/wayland-info.c:1784:4: error: use of undeclared identifier 'CLOCK_REALTIME_COARSE'
             [CLOCK_REALTIME_COARSE] =       "CLOCK_REALTIME_COARSE",
              ^
wayland-info/wayland-info.c:1785:4: error: use of undeclared identifier 'CLOCK_MONOTONIC_COARSE'
             [CLOCK_MONOTONIC_COARSE] =      "CLOCK_MONOTONIC_COARSE",
              ^
wayland-info/wayland-info.c:1791:40: error: invalid application of 'sizeof' to an incomplete type 'const char *[]'
        if (clk_id < 0 || (unsigned)clk_id >= ARRAY_LENGTH(names))
                                              ^~~~~~~~~~~~~~~~~~~
wayland-info/wayland-info.c:49:33: note: expanded from macro 'ARRAY_LENGTH'
 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
                                 ^~~

Signed-off-by: default avatarJan Beich <jbeich@FreeBSD.org>
parent 215ea070
No related branches found
No related tags found
1 merge request!1wayland-info: unbreak build on FreeBSD
......@@ -1809,9 +1809,15 @@ clock_name(clockid_t clk_id)
static const char *names[] = {
[CLOCK_REALTIME] = "CLOCK_REALTIME",
[CLOCK_MONOTONIC] = "CLOCK_MONOTONIC",
#ifdef CLOCK_MONOTONIC_RAW
[CLOCK_MONOTONIC_RAW] = "CLOCK_MONOTONIC_RAW",
#endif
#ifdef CLOCK_REALTIME_COARSE
[CLOCK_REALTIME_COARSE] = "CLOCK_REALTIME_COARSE",
#endif
#ifdef CLOCK_MONOTONIC_COARSE
[CLOCK_MONOTONIC_COARSE] = "CLOCK_MONOTONIC_COARSE",
#endif
#ifdef CLOCK_BOOTTIME
[CLOCK_BOOTTIME] = "CLOCK_BOOTTIME",
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment