mirror of
https://github.com/RGBCube/serenity
synced 2025-07-30 06:07:34 +00:00
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.
This commit is contained in:
parent
68b4a75ad2
commit
181cd8fb0c
9 changed files with 261 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
|||
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) {
|
Loading…
Add table
Add a link
Reference in a new issue