From 48b4e0bf6f1cc4ce4831c2212d57f00fe792468f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 20 Jul 2016 12:44:16 +0200 Subject: Improve library version handling Output the version as a define into the private config header as a define using a hex number. Like that we can easily do version checks on libraries using the QT_LIBRARY_VERSION(lib) and QT_VERSION_CHECK() macros. Change-Id: I6dc4ac6550886ca95c5542b6e75cd933ed079d76 Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- src/platformsupport/input/libinput/libinput.pri | 2 -- src/platformsupport/input/libinput/qlibinputpointer.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/platformsupport/input/libinput') diff --git a/src/platformsupport/input/libinput/libinput.pri b/src/platformsupport/input/libinput/libinput.pri index 9595e15f4e..d9f64c7449 100644 --- a/src/platformsupport/input/libinput/libinput.pri +++ b/src/platformsupport/input/libinput/libinput.pri @@ -19,5 +19,3 @@ contains(QT_CONFIG, xkbcommon-evdev) { } else { DEFINES += QT_NO_XKBCOMMON_EVDEV } - -DEFINES += QT_LIBINPUT_VERSION_MAJOR=$$QMAKE_LIBINPUT_VERSION_MAJOR QT_LIBINPUT_VERSION_MINOR=$$QMAKE_LIBINPUT_VERSION_MINOR diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp index d5a3a8b437..3b583ec99d 100644 --- a/src/platformsupport/input/libinput/qlibinputpointer.cpp +++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp @@ -96,7 +96,7 @@ void QLibInputPointer::processMotion(libinput_event_pointer *e) void QLibInputPointer::processAxis(libinput_event_pointer *e) { -#if QT_LIBINPUT_VERSION_MAJOR == 0 && QT_LIBINPUT_VERSION_MINOR <= 7 +#if QT_LIBRARY_VERSION(libinput) < QT_VERSION_CHECK(0, 8, 0) const double v = libinput_event_pointer_get_axis_value(e) * 120; const Qt::Orientation ori = libinput_event_pointer_get_axis(e) == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL ? Qt::Vertical : Qt::Horizontal; -- cgit v1.2.3