michaelforney / swc

a library for making a simple Wayland compositor
MIT License
616 stars 52 forks source link

swc fails to compile when libinput >0.8 #23

Closed n3rdopolis closed 9 years ago

n3rdopolis commented 9 years ago

I think it was breakerage introduced in libinput 0.9 CC libswc/surface.o libswc/seat.c: In function ‘handle_libinput_data’: libswc/seat.c:326:22: error: too few arguments to function ‘libinput_event_pointer_get_axis_value’ (libinput_event_pointer_get_axis_value(event)); ^ In file included from libswc/seat.c:43:0: /opt/include/libinput.h:703:1: note: declared here libinput_event_pointer_get_axis_value(struct libinput_event_pointer _event, ^ libswc/seat.c:328:29: error: implicit declaration of function ‘libinput_event_pointer_get_axis’ [-Werror=implicit-function-declaration] libinput_event_pointer_getaxis(event), amount); ^ cc1: some warnings being treated as errors common.mk:15: recipe for target 'libswc/seat.o' failed make: ** [libswc/seat.o] Error 1 make: *\ Waiting for unfinished jobs.... PackageCompileSource finished in 1 seconds

ghost commented 9 years ago

Same problem. I made this pull request: https://github.com/michaelforney/swc/pull/24

n3rdopolis commented 9 years ago

It appears that this allows swc to build!

staalmannen commented 9 years ago

I have the same issue. Thanks for the patch.

stapelberg commented 9 years ago

Well, this breaks compilation on systems without the new libinput API (such as Debian testing). Is there a way we can have conditional compilation for either the new or the old API?

michaelforney commented 9 years ago

I'm okay with this in this case since it is such a small change, but in general I'd like to keep ifdefs to a minimum.

I don't follow Debian testing, so if I do this, will you send me a pull request when it is no longer necessary?

stapelberg commented 9 years ago

I agree that keeping ifdefs to a minimum is a good idea. I can’t promise to send you a pull request when this is no longer necessary. I think we’re talking about O(years) here, since many people use software on distributions that stick around for a while, e.g. Ubuntu 14.04 LTS. So, the next LTS will come out in 2016, and history tells us that people will still be on the previous LTS for quite a while. I’d say just add a reminder to your calendar for 2017 to remove the ifdef? :)

michaelforney commented 9 years ago

Oh. I was assuming that Debian testing would soon update to a newer libinput and this would be a short term thing. I think when you decide to try wayland, you are agreeing to use versions of packages on the bleeding-edge side. For example, the xdg-shell unstable version update only works with gtk+ 3.15+.

I think if people want to use the old libinput API, they can simply revert my commit that updated it.