diff options
author | Abseil Team <absl-team@google.com> | 2023-06-28 13:34:32 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-06-28 13:35:17 -0700 |
commit | 2119e40e17b56e38d077279fa7480b04d769d01d (patch) | |
tree | 8b2f0361dff2f703c5788fcdda2c30fd7079399e /absl/time/internal/cctz/src/time_zone_libc.cc | |
parent | bba65bd11506292aad0258ab516fe9eabf507e18 (diff) | |
download | abseil-2119e40e17b56e38d077279fa7480b04d769d01d.tar.gz abseil-2119e40e17b56e38d077279fa7480b04d769d01d.tar.bz2 abseil-2119e40e17b56e38d077279fa7480b04d769d01d.zip |
Roll forward of CCTZ update; fixed by clang release.
PiperOrigin-RevId: 544146637
Change-Id: I5ca44465f451956ae246081ce826891599b18b9c
Diffstat (limited to 'absl/time/internal/cctz/src/time_zone_libc.cc')
-rw-r--r-- | absl/time/internal/cctz/src/time_zone_libc.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/absl/time/internal/cctz/src/time_zone_libc.cc b/absl/time/internal/cctz/src/time_zone_libc.cc index e503a858..d0146122 100644 --- a/absl/time/internal/cctz/src/time_zone_libc.cc +++ b/absl/time/internal/cctz/src/time_zone_libc.cc @@ -62,7 +62,7 @@ auto tm_zone(const std::tm& tm) -> decltype(tzname[0]) { } #elif defined(__native_client__) || defined(__myriad2__) || \ defined(__EMSCRIPTEN__) -// Uses the globals: 'timezone' and 'tzname'. +// Uses the globals: '_timezone' and 'tzname'. auto tm_gmtoff(const std::tm& tm) -> decltype(_timezone + 0) { const bool is_dst = tm.tm_isdst > 0; return _timezone + (is_dst ? 60 * 60 : 0); @@ -193,8 +193,9 @@ std::time_t find_trans(std::time_t lo, std::time_t hi, tm_gmtoff_t offset) { } // namespace -TimeZoneLibC::TimeZoneLibC(const std::string& name) - : local_(name == "localtime") {} +std::unique_ptr<TimeZoneLibC> TimeZoneLibC::Make(const std::string& name) { + return std::unique_ptr<TimeZoneLibC>(new TimeZoneLibC(name)); +} time_zone::absolute_lookup TimeZoneLibC::BreakTime( const time_point<seconds>& tp) const { @@ -323,6 +324,9 @@ std::string TimeZoneLibC::Description() const { return local_ ? "localtime" : "UTC"; } +TimeZoneLibC::TimeZoneLibC(const std::string& name) + : local_(name == "localtime") {} + } // namespace cctz } // namespace time_internal ABSL_NAMESPACE_END |