struct tm doesn't have tm_gmtoff in ISO C

The field is a BSD and GNU extension (https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html)
pull/1306/head
Lance Sun 6 years ago committed by GitHub
parent 408a2229d6
commit 8cecd3a6b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -307,8 +307,10 @@ SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm)
};
auto offset_seconds = helper::calculate_gmt_offset(tm);
#else
#elif defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
auto offset_seconds = tm.tm_gmtoff;
#else
auto offset_seconds = 0;
#endif
return static_cast<int>(offset_seconds / 60);

Loading…
Cancel
Save