You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.2 KiB

  1. From e7a2927d5e44209ff61405c9beb3d188eeedc3f6 Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Sun, 26 Apr 2020 20:27:58 -0700
  4. Subject: [PATCH] libevdev-events: fix compilation with older kernels
  5. input_event_(u)sec was introduced in kernel 4.16. Older kernels do not
  6. have this.
  7. Signed-off-by: Rosen Penev <rosenp@gmail.com>
  8. ---
  9. tools/libevdev-events.c | 5 +++++
  10. tools/mouse-dpi-tool.c | 5 +++++
  11. 2 files changed, 10 insertions(+)
  12. diff --git a/tools/libevdev-events.c b/tools/libevdev-events.c
  13. index 547513e..e5940c9 100644
  14. --- a/tools/libevdev-events.c
  15. +++ b/tools/libevdev-events.c
  16. @@ -33,6 +33,11 @@
  17. #include "libevdev/libevdev.h"
  18. +#ifndef input_event_sec
  19. +#define input_event_sec time.tv_sec
  20. +#define input_event_usec time.tv_usec
  21. +#endif
  22. +
  23. static void
  24. print_abs_bits(struct libevdev *dev, int axis)
  25. {
  26. diff --git a/tools/mouse-dpi-tool.c b/tools/mouse-dpi-tool.c
  27. index 9961f3a..c4830e7 100644
  28. --- a/tools/mouse-dpi-tool.c
  29. +++ b/tools/mouse-dpi-tool.c
  30. @@ -37,6 +37,11 @@
  31. #include "libevdev/libevdev.h"
  32. +#ifndef input_event_sec
  33. +#define input_event_sec time.tv_sec
  34. +#define input_event_usec time.tv_usec
  35. +#endif
  36. +
  37. #define min(a, b) (((a) < (b)) ? (a) : (b))
  38. #define max(a, b) (((a) > (b)) ? (a) : (b))
  39. --
  40. 2.25.3