From beda8f35b251fbede0f7a43112ea74371dfd9a6b Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 9 Mar 2022 13:38:51 +0100 Subject: [PATCH] xrt: fix -Wmissing-field-initializers warning in comp_window_wayland.c Newer wayland protocols have a new filed in xdg_toplevel_listener which is not initialized: ----------------------------------------------------------------------- [215/315] Building C object src/xrt/compositor/CMakeFiles/comp_main.dir/main/comp_window_wayland.c.o .../src/xrt/compositor/main/comp_window_wayland.c:182:1: warning: missing field 'configure_bounds' initializer [-Wmissing-field-initializers] }; ^ 1 warning generated. ----------------------------------------------------------------------- Detect the version when this is needed and initialize the field to silence the warning. --- src/xrt/compositor/main/comp_window_wayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xrt/compositor/main/comp_window_wayland.c b/src/xrt/compositor/main/comp_window_wayland.c index 4c900cd0f..03e57be67 100644 --- a/src/xrt/compositor/main/comp_window_wayland.c +++ b/src/xrt/compositor/main/comp_window_wayland.c @@ -179,6 +179,9 @@ _xdg_toplevel_close_cb(void *data, struct xdg_toplevel *toplevel) static const struct xdg_toplevel_listener xdg_toplevel_listener = { _xdg_toplevel_configure_cb, _xdg_toplevel_close_cb, +#if XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION >= 4 + NULL, +#endif }; static void