1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 04:57:44 +00:00
serenity/Ports/abseil/patches/0002-Remove-LibC-timezone-support-on-Serenity.patch
kleines Filmröllchen 181cd8fb0c Ports: Add abseil and protobuf
Abseil's Serenity support is a little limited:
- No support for any timezone shenanigans since protobuf hopefully
  doesn't use those. For now, abseil will always believe to be in UTC on
  Serenity.
- In most places where explicit platforms need to be added to a list of
  supported platforms, Serenity will be missing. Again I only added the
  ones that are required for protobuf.
2023-10-03 15:21:26 +02:00

37 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= <filmroellchen@serenityos.org>
Date: Sat, 16 Sep 2023 11:09:17 +0200
Subject: [PATCH] Remove LibC timezone support on Serenity
---
absl/time/internal/cctz/src/time_zone_libc.cc | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/absl/time/internal/cctz/src/time_zone_libc.cc b/absl/time/internal/cctz/src/time_zone_libc.cc
index d01461222e9e60461384733162d1e042aa51147b..8ac1db60e61610bfbc2adc9c2f4658affd65712b 100644
--- a/absl/time/internal/cctz/src/time_zone_libc.cc
+++ b/absl/time/internal/cctz/src/time_zone_libc.cc
@@ -91,6 +91,11 @@ auto tm_gmtoff(const std::tm& tm) -> decltype(tm.tm_gmtoff) {
auto tm_gmtoff(const std::tm& tm) -> decltype(tm.__tm_gmtoff) {
return tm.__tm_gmtoff;
}
+#elif defined(__serenity__)
+template <typename T>
+auto tm_gmtoff(const T&) -> int {
+ return 0;
+}
#else
template <typename T>
auto tm_gmtoff(const T& tm) -> decltype(tm.tm_gmtoff) {
@@ -107,6 +112,11 @@ auto tm_zone(const std::tm& tm) -> decltype(tm.tm_zone) { return tm.tm_zone; }
auto tm_zone(const std::tm& tm) -> decltype(tm.__tm_zone) {
return tm.__tm_zone;
}
+#elif defined(__serenity__)
+template <typename T>
+auto tm_zone(const T&) -> char const* {
+ return "UTC";
+}
#else
template <typename T>
auto tm_zone(const T& tm) -> decltype(tm.tm_zone) {