GNOME Bugzilla – Bug 774324
Fail to build without wayland
Last modified: 2017-02-08 17:50:37 UTC
In file panels/info/cc-info-panel.c, function get_graphics_data, both GDK_IS_X11_DISPLAY and GDK_IS_WAYLAND_DISPLAY are used when only one of them is available, causing linking error when wayland is disabled: ../panels/info/.libs/libinfo.a(cc-info-panel.o): In function `get_graphics_data': cc-info-panel.c:(.text+0x673): undefined reference to `GDK_IS_WAYLAND_DISPLAY' ../panels/info/.libs/libinfo.a(cc-info-panel.o): In function `get_graphics_data': cc-info-panel.c:(.text+0x673): undefined reference to `GDK_IS_WAYLAND_DISPLAY' clang: error: linker command failed with exit code 1 (use -v to see invocation)
Created attachment 339691 [details] [review] info: Fix build when Wayland is disabled
Review of attachment 339691 [details] [review]: gboolean x11_or_wayland = FALSE; #ifdef GDK_WINDOWING_X11 x11_or_wayland = GDK_IS_X11_DISPLAY (display); #endif #ifdef GDK_WINDOWING_WAYLAND x11_or_wayland = x11_or_wayland || GDK_IS_WAYLAND_DISPLAY (display); #endif ... ::: panels/info/cc-info-panel.c @@ +412,2 @@ #if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_WAYLAND) + int x11_or_wayland = 0; Why not a boolean? @@ +413,3 @@ + int x11_or_wayland = 0; +#ifdef GDK_WINDOWING_X11 + x11_or_wayland = x11_or_wayland || GDK_IS_X11_DISPLAY (display); x11_or_wayland = GDK_IS_X11_DISPLAY (display);
(In reply to Bastien Nocera from comment #2) > Review of attachment 339691 [details] [review] [review]: > > Why not a boolean? > Do you prefer GLib gboolean or C99 _Bool(bool)? Using either of them works here, but I am not sure if you have any preference.
Created attachment 339696 [details] [review] info: Fix build when Wayland is disabled
Created attachment 345256 [details] [review] info: Fix build when Wayland is disabled
Attachment 345256 [details] pushed as 33d8c94 - info: Fix build when Wayland is disabled