[PATCH 1/4] Add ABS_MT_MAX to build with old input.h

David Herrmann dh.herrmann at gmail.com
Tue Sep 10 04:14:23 PDT 2013


Hi

On Sat, Sep 7, 2013 at 2:25 AM, Martin Minarik
<minarik11 at student.fiit.stuba.sk> wrote:
> Enables build on kernels that didn't have ABS_MT_TOOL_Y

Just curious: Why can't you install more recent kernel-headers? Do
distributions really not update them?

> Signed-off-by: Martin Minarik <minarik11 at student.fiit.stuba.sk>
>
> ---
>  libevdev/libevdev-int.h |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/libevdev/libevdev-int.h b/libevdev/libevdev-int.h
> index 7f21060..ce044e3 100644
> --- a/libevdev/libevdev-int.h
> +++ b/libevdev/libevdev-int.h
> @@ -35,7 +35,11 @@
>  #define MAX_NAME 256
>  #define MAX_SLOTS 32
>  #define ABS_MT_MIN ABS_MT_SLOT
> -#define ABS_MT_MAX ABS_MT_TOOL_Y
> +#ifdef ABS_MT_DISTANCE
> +       #define ABS_MT_MAX ABS_MT_DISTANCE
> +#else
> +       #define ABS_MT_MAX ABS_MT_TOOL_Y
> +#endif

Please don't use indented macros. Instead, use:
#  define XY Z

Besides, what about:

#ifndef ABS_MT_DISTANCE
#  define ABS_MT_DISTANCE 0x3b
#endif

I remember a previous discussion about this and I thought we agreed to
define missing constants instead of changing MAX/CNT values. But I'm
not sure it was libevdev.

Thanks
David

>  #define ABS_MT_CNT (ABS_MT_MAX - ABS_MT_MIN + 1)
>  #define LIBEVDEV_EXPORT __attribute__((visibility("default")))
>  #define LIBEVDEV_PRINTF(_format, _args) __attribute__ ((format (printf, _format, _args)))
> --
> 1.7.10.4
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list