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

Peter Hutterer peter.hutterer at who-t.net
Sun Aug 25 15:18:22 PDT 2013


On Fri, Aug 23, 2013 at 07:17:32PM +0200, Martin Minarik wrote:
> Enables build on kernels that didn't have ABS_MT_TOOL_Y
> ---
>  libevdev/libevdev-int.h |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/libevdev/libevdev-int.h b/libevdev/libevdev-int.h
> index a36be62..71057ad 100644
> --- a/libevdev/libevdev-int.h
> +++ b/libevdev/libevdev-int.h
> @@ -35,7 +35,12 @@
>  #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
> +#endif
> +#ifdef ABS_MT_TOOL_Y
> +	#define ABS_MT_MAX ABS_MT_TOOL_Y
> +#endif
>  #define ABS_MT_CNT (ABS_MT_MAX - ABS_MT_MIN + 1)
>  
>  #undef min
> -- 
> 1.7.10.4

couple of things:
* this redefines ABS_MT_MAX and produces a compiler warning
* easier to just define ABS_MT_DISTANCE through to ABS_MT_TOOL_Y. wastes
  a bit of space on kernels lacking it, but nothing severe
* at least for ifdef/define combinations please don't indent,
  or if it's needed (multi-line), indent as

#ifdef blah
#       define blah 1
#       define foo 2
#       define bar 3
#endif

Cheers,
   Peter



More information about the Input-tools mailing list