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

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 10 15:59:25 PDT 2013


On Tue, Sep 10, 2013 at 01:14:23PM +0200, David Herrmann wrote:
> 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?

depending on your distribution, you don't necessarily get new kernel
headers.  RHEL6 ships with what is nominally a 2.6.32 but has had a load of
patches backported. So some new definitions may be available but not all of
them.

with libraries such as libevdev it's easier to to define some constants to
keep the library build across multiple versions instead of relying on
distributions do to so individually.

> > 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.

sounds familiar, but can't remember where this was either. Either way - yes,
please define the missing tools instead of _MAX.

Cheers,
   Peter

> >  #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


More information about the Input-tools mailing list