After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 792281 - META_IS_BACKEND_NATIVE cannot be used when native backend is disabled
META_IS_BACKEND_NATIVE cannot be used when native backend is disabled
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other FreeBSD
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2018-01-06 19:27 UTC by Ting-Wei Lan
Modified: 2018-01-09 04:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Fix build when native backend is disabled (1.04 KB, patch)
2018-01-06 19:28 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2018-01-06 19:27:57 UTC
In function maybe_save_numlock_state, file src/wayland/meta-wayland-keyboard.c, META_IS_BACKEND_NATIVE is used without #ifdef checks. This causes build failure when native backend is disabled but wayland is enabled.

  CC       wayland/meta-wayland-keyboard.lo
src/wayland/meta-wayland-keyboard.c:283:35: warning: cast from 'char *' to 'typeof (keyboard)' (aka 'struct _MetaWaylandKeyboard *') increases required alignment from 1 to 8 [-Wcast-align]
src/wayland/meta-wayland-keyboard.c:449:8: warning: implicit declaration of function 'META_IS_BACKEND_NATIVE' is invalid in C99 [-Wimplicit-function-declaration]
  CCLD     libmutter-1.la
copying selected object files to avoid basename conflicts...
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     mutter
./.libs/libmutter-1.so: undefined reference to `META_IS_BACKEND_NATIVE'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Since this function doesn't do any work when 'META_IS_BACKEND_NATIVE (meta_get_backend ())' is false, I think we can make it empty when native backend is disabled.
Comment 1 Ting-Wei Lan 2018-01-06 19:28:59 UTC
Created attachment 366430 [details] [review]
build: Fix build when native backend is disabled
Comment 2 Florian Müllner 2018-01-08 19:33:27 UTC
Review of attachment 366430 [details] [review]:

LGTM
Comment 3 Ting-Wei Lan 2018-01-09 04:02:05 UTC
Attachment 366430 [details] pushed as 31eafba - build: Fix build when native backend is disabled