From 71f79b9de1e4fb08c5afeb4e1b3f113a2c5531af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Tue, 12 Jul 2022 19:44:59 +0200 Subject: [PATCH] libwacom: fix warnings building without libwacom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the libwacom build option is set to false the compiler throws these warnings: ../udev/libinput-device-group.c:95:1: warning: ‘wacom_handle_ekr’ defined but not used [-Wunused-function] 95 | wacom_handle_ekr(struct udev_device *device, | ^~~~~~~~~~~~~~~~ [205/237] Compiling C object 'libinput-test-suite@exe/test_test-tablet.c.o'. ../test/test-tablet.c:5440:1: warning: ‘verify_left_handed_touch_sequence’ defined but not used [-Wunused-function] 5440 | verify_left_handed_touch_sequence(struct litest_device *finger, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../test/test-tablet.c:5385:1: warning: ‘verify_left_handed_tablet_sequence’ defined but not used [-Wunused-function] 5385 | verify_left_handed_tablet_sequence(struct litest_device *tablet, # | ^~~~~~~~~~~~~~~~ # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add the required guards to fix the warnings. Fix #791. Signed-off-by: José Expósito --- test/test-tablet.c | 2 ++ udev/libinput-device-group.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test-tablet.c b/test/test-tablet.c index ce1c7b6a..098c9e56 100644 --- a/test/test-tablet.c +++ b/test/test-tablet.c @@ -5334,6 +5334,7 @@ START_TEST(touch_arbitration_late_touch_lift) } END_TEST +#if HAVE_LIBWACOM static void verify_left_handed_tablet_motion(struct litest_device *tablet, struct libinput *li, @@ -5453,6 +5454,7 @@ verify_left_handed_touch_sequence(struct litest_device *finger, litest_touch_up(finger, 0); libinput_dispatch(li); } +#endif START_TEST(tablet_rotation_left_handed) { diff --git a/udev/libinput-device-group.c b/udev/libinput-device-group.c index 0622ba33..3da904e0 100644 --- a/udev/libinput-device-group.c +++ b/udev/libinput-device-group.c @@ -62,7 +62,6 @@ out: if (db) libwacom_database_destroy(db); } -#endif static int find_tree_distance(struct udev_device *a, struct udev_device *b) @@ -148,6 +147,7 @@ wacom_handle_ekr(struct udev_device *device, udev_enumerate_unref(e); } +#endif int main(int argc, char **argv) {