rcinput: Fix build issues with _TIME_BITS=64

- Updated rcinput.cpp to use input_event_sec and input_event_usec macros
  for accessing time members of input_event structure.
- Included necessary headers for time functions and structures.
- Ensured compatibility with various definitions of input_event structure
  as per input.h.

This should resolves compilation errors related to accessing time members
of input_event structure when _TIME_BITS=64 is defined.
This commit is contained in:
2024-07-04 16:08:36 +02:00
parent 27a9141275
commit a46554db1e

View File

@@ -36,6 +36,7 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/time.h>
#include <linux/input.h>
#include <utime.h>
#include <stdlib.h>
#ifdef KEYBOARD_INSTEAD_OF_REMOTE_CONTROL
@@ -1338,7 +1339,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
* Everything would be much easier if we could use the post-kernel 3.4
* EVIOCSCLOCKID ioctl :-) */
struct timespec t1;
now_pressed = ev.time.tv_usec + ev.time.tv_sec * 1000000ULL;
now_pressed = ev.input_event_sec * 1000000ULL + ev.input_event_usec;
if (!clock_gettime(CLOCK_MONOTONIC, &t1)) {
struct timeval t2;
gettimeofday(&t2, NULL);