libevdevPlus: fix build w/ musl-1.2.1 (time64)

This commit is contained in:
Jürgen Buchmüller 2020-12-11 16:58:53 +01:00
parent d00a96d444
commit 3e84c432be
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
--- InputEvent.hpp 2020-02-11 17:02:44.000000000 +0100
+++ InputEvent.hpp 2020-12-11 16:56:14.324990733 +0100
@@ -20,7 +20,7 @@
public:
input_event event{};
- timeval &Time = event.time;
+ timeval Time = {event.input_event_sec, event.input_event_usec};
uint16_t &Type = event.type;
uint16_t &Code = event.code;
int32_t &Value = event.value;
@@ -36,8 +36,10 @@
Code = code;
Value = value;
- if (time)
- memcpy(&event.time, time, sizeof(timeval));
+ if (time) {
+ event.input_event_sec = time->tv_sec;
+ event.input_event_usec = time->tv_usec;
+ }
}
friend void swap(InputEvent &first, InputEvent &second) {