aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtwebengine/chromium/0021-chromium-Fix-build-on-32bit-arches-with-64bit-time_t.patch
blob: ac16068c462e4a60f07bb589d569bd1614da8a2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 6ae9112ffea9a5b7d41a06c3d33e55e4f32d8b5a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 30 Nov 2019 10:07:43 -0800
Subject: [PATCH] Fix build on 32bit arches with 64bit time_t

time element is deprecated on new input_event structure in kernel's
input.h [1]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 chromium/ui/events/ozone/evdev/event_converter_evdev.cc    | 4 ++--
 chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc | 6 +++---
 chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.h  | 5 +++++
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/chromium/ui/events/ozone/evdev/event_converter_evdev.cc b/chromium/ui/events/ozone/evdev/event_converter_evdev.cc
index 684514ff011..e2f2ae0b633 100644
--- a/chromium/ui/events/ozone/evdev/event_converter_evdev.cc
+++ b/chromium/ui/events/ozone/evdev/event_converter_evdev.cc
@@ -168,8 +168,8 @@ void EventConverterEvdev::SetPalmSuppressionCallback(
 base::TimeTicks EventConverterEvdev::TimeTicksFromInputEvent(
     const input_event& event) {
   base::TimeTicks timestamp =
-      ui::EventTimeStampFromSeconds(event.time.tv_sec) +
-      base::TimeDelta::FromMicroseconds(event.time.tv_usec);
+      ui::EventTimeStampFromSeconds(event.input_event_sec) +
+      base::TimeDelta::FromMicroseconds(event.input_event_usec);
   ValidateEventTimeClock(&timestamp);
   return timestamp;
 }
diff --git a/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc b/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc
index 363c3183e05..4fccfd62f84 100644
--- a/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc
+++ b/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.cc
@@ -59,11 +59,11 @@ void TouchEventLogEvdev::DumpLog(const char* filename) {
   for (int i = 0; i < kDebugBufferSize; ++i) {
     struct TouchEvent* te =
         &logged_events_[(debug_buffer_tail_ + i) % kDebugBufferSize];
-    if (te->ev.time.tv_sec == 0 && te->ev.time.tv_usec == 0)
+    if (te->ev.input_event_sec == 0 && te->ev.input_event_usec == 0)
       continue;
     std::string event_string = base::StringPrintf(
-        "E: %ld.%06ld %04x %04x %d %d\n", te->ev.time.tv_sec,
-        te->ev.time.tv_usec, te->ev.type, te->ev.code, te->ev.value, te->slot);
+        "E: %ld.%06ld %04x %04x %d %d\n", te->ev.input_event_sec,
+        te->ev.input_event_usec, te->ev.type, te->ev.code, te->ev.value, te->slot);
     report_content += event_string;
   }
   file.Write(0, report_content.c_str(), report_content.length());
diff --git a/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.h b/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.h
index ccd3a499a38..5a2da89d09a 100644
--- a/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.h
+++ b/chromium/ui/events/ozone/evdev/touch_evdev_debug_buffer.h
@@ -14,6 +14,11 @@
 
 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
 
+#ifndef input_event_sec
+#define input_event_sec time.tv_sec
+#define input_event_usec time.tv_usec
+#endif
+
 namespace ui {
 
 class EventDeviceInfo;
-- 
2.24.0