Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jun 8, 2024
1 parent 3bba2fa commit 613e38a
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@ namespace cctz {
namespace {

#if defined(_WIN32) || defined(_WIN64)
#if defined(_UCRT)
// Uses the globals: '_timezone', '_dstbias' and '_tzname'.
auto tm_gmtoff(const std::tm& tm) -> decltype(_timezone + _dstbias) {
const bool is_dst = tm.tm_isdst > 0;
return _timezone + (is_dst ? _dstbias : 0);
// This is just a hack because s2 doesn't need this and it causes
// problems on Windows before UCRT.
return 0;
}
#else
#error "Does this ever happen?"
#endif
auto tm_zone(const std::tm& tm) -> decltype(_tzname[0]) {
const bool is_dst = tm.tm_isdst > 0;
return _tzname[is_dst];
Expand Down

0 comments on commit 613e38a

Please sign in to comment.