summaryrefslogtreecommitdiffstats
path: root/contrib/restricted/abseil-cpp/patches/freertos-pr-2053.patch
blob: d4722342e4b8e4b47553b213d79ef13bb0cbb1d8 (plain) (blame)
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
71
72
--- contrib/restricted/abseil-cpp/absl/base/internal/sysinfo.cc	(index)
+++ contrib/restricted/abseil-cpp/absl/base/internal/sysinfo.cc	(working tree)
@@ -50,6 +50,10 @@
 #include <zircon/process.h>
 #endif
 
+#if defined(__FREERTOS__)
+#include <task.h>
+#endif
+
 #include <string.h>
 
 #include <cassert>
@@ -466,6 +470,12 @@ pid_t GetTID() {
   return static_cast<pid_t>(zx_thread_self());
 }
 
+#elif defined(__FREERTOS__)
+
+pid_t GetTID() {
+  return static_cast<pid_t>(uxTaskGetTaskNumber(xTaskGetCurrentTaskHandle()));
+}
+
 #else
 
 // Fallback implementation of `GetTID` using `pthread_self`.
--- contrib/restricted/abseil-cpp/absl/debugging/internal/elf_mem_image.h	(index)
+++ contrib/restricted/abseil-cpp/absl/debugging/internal/elf_mem_image.h	(working tree)
@@ -35,7 +35,7 @@
 #if defined(__ELF__) && !defined(__OpenBSD__) && !defined(__QNX__) &&    \
     !defined(__asmjs__) && !defined(__wasm__) && !defined(__HAIKU__) &&  \
     !defined(__sun) && !defined(__VXWORKS__) && !defined(__hexagon__) && \
-    !defined(__XTENSA__)
+    !defined(__XTENSA__)  && !defined(__FREERTOS__)
 #define ABSL_HAVE_ELF_MEM_IMAGE 1
 #endif
 
--- contrib/restricted/abseil-cpp/absl/log/internal/log_message.cc	(index)
+++ contrib/restricted/abseil-cpp/absl/log/internal/log_message.cc	(working tree)
@@ -221,1 +221,1 @@ LogMessage::LogMessageData::LogMessageData(absl::string_view file,
-  EncodeVarint(EventTag::kFileLine, entry.source_line(), &encoded_remaining());
+  EncodeVarint(EventTag::kFileLine, static_cast<int32_t>(entry.source_line()), &encoded_remaining());
--- contrib/restricted/abseil-cpp/absl/log/internal/proto.h	(index)
+++ contrib/restricted/abseil-cpp/absl/log/internal/proto.h	(working tree)
@@ -79,6 +79,9 @@ inline bool EncodeVarint(uint64_t tag, uint32_t value, absl::Span<char> *buf) {
 inline bool EncodeVarint(uint64_t tag, int32_t value, absl::Span<char> *buf) {
   return EncodeVarint(tag, static_cast<uint64_t>(value), buf);
 }
+inline bool EncodeVarint(uint64_t tag, bool value, absl::Span<char> *buf) {
+  return EncodeVarint(tag, static_cast<uint64_t>(value), buf);
+}
 
 // Encodes the specified integer as a varint field using ZigZag encoding and
 // returns true if it fits.
--- contrib/restricted/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc	(index)
+++ contrib/restricted/abseil-cpp/absl/time/internal/cctz/src/time_zone_libc.cc	(working tree)
@@ -81,6 +81,15 @@ auto tm_zone(const std::tm& tm) -> decltype(tzname[0]) {
   const bool is_dst = tm.tm_isdst > 0;
   return tzname[is_dst];
 }
+#elif defined(__FREERTOS__)
+long int tm_gmtoff(const std::tm& tm) {
+  (void)tm;
+  return 0;
+}
+const char* tm_zone(const std::tm& tm) {
+  (void)tm;
+  return "UTC";
+}
 #else
 // Adapt to different spellings of the struct std::tm extension fields.
 #if defined(tm_gmtoff)