Skip to content
Snippets Groups Projects

wayland-info: unbreak build on FreeBSD

Merged Jan Beich requested to merge (removed):freebsd into main
1 file
+ 10
0
Compare changes
  • Side-by-side
  • Inline
  • d367b894
    wayland-info: unbreak build on FreeBSD · d367b894
    Jan Beich authored
    ../wayland-info/wayland-info.c:258:28: error: use of undeclared identifier 'program_invocation_short_name'
                    fprintf(stderr, "[%s] ", program_invocation_short_name);
                                             ^
    ../wayland-info/wayland-info.c:1753:4: error: use of undeclared identifier 'CLOCK_MONOTONIC_RAW'
                    [CLOCK_MONOTONIC_RAW] = "CLOCK_MONOTONIC_RAW",
                     ^
    ../wayland-info/wayland-info.c:1754:4: error: use of undeclared identifier 'CLOCK_REALTIME_COARSE'
                    [CLOCK_REALTIME_COARSE] =       "CLOCK_REALTIME_COARSE",
                     ^
    ../wayland-info/wayland-info.c:1755:4: error: use of undeclared identifier 'CLOCK_MONOTONIC_COARSE'
                    [CLOCK_MONOTONIC_COARSE] =      "CLOCK_MONOTONIC_COARSE",
                     ^
    ../wayland-info/wayland-info.c:1761: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:45:33: note: expanded from macro 'ARRAY_LENGTH'
     #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
                                     ^~~
    5 errors generated.
@@ -255,7 +255,11 @@ static void *
@@ -255,7 +255,11 @@ static void *
fail_on_null(void *p, size_t size, char *file, int32_t line)
fail_on_null(void *p, size_t size, char *file, int32_t line)
{
{
if (p == NULL) {
if (p == NULL) {
 
+1
#ifdef __linux__
fprintf(stderr, "[%s] ", program_invocation_short_name);
fprintf(stderr, "[%s] ", program_invocation_short_name);
 
#else
 
fprintf(stderr, "[%s] ", getprogname());
 
#endif
if (file)
if (file)
fprintf(stderr, "%s:%d: ", file, line);
fprintf(stderr, "%s:%d: ", file, line);
fprintf(stderr, "out of memory");
fprintf(stderr, "out of memory");
@@ -1750,9 +1754,15 @@ clock_name(clockid_t clk_id)
@@ -1750,9 +1754,15 @@ clock_name(clockid_t clk_id)
static const char *names[] = {
static const char *names[] = {
[CLOCK_REALTIME] = "CLOCK_REALTIME",
[CLOCK_REALTIME] = "CLOCK_REALTIME",
[CLOCK_MONOTONIC] = "CLOCK_MONOTONIC",
[CLOCK_MONOTONIC] = "CLOCK_MONOTONIC",
 
#ifdef CLOCK_MONOTONIC_RAW
[CLOCK_MONOTONIC_RAW] = "CLOCK_MONOTONIC_RAW",
[CLOCK_MONOTONIC_RAW] = "CLOCK_MONOTONIC_RAW",
 
#endif
 
#ifdef CLOCK_REALTIME_COARSE
[CLOCK_REALTIME_COARSE] = "CLOCK_REALTIME_COARSE",
[CLOCK_REALTIME_COARSE] = "CLOCK_REALTIME_COARSE",
 
#endif
 
#ifdef CLOCK_MONOTONIC_COARSE
[CLOCK_MONOTONIC_COARSE] = "CLOCK_MONOTONIC_COARSE",
[CLOCK_MONOTONIC_COARSE] = "CLOCK_MONOTONIC_COARSE",
 
#endif
#ifdef CLOCK_BOOTTIME
#ifdef CLOCK_BOOTTIME
[CLOCK_BOOTTIME] = "CLOCK_BOOTTIME",
[CLOCK_BOOTTIME] = "CLOCK_BOOTTIME",
#endif
#endif
Loading