Skip to content

Commit

Permalink
Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if…
Browse files Browse the repository at this point in the history
… __STDC_LIB_EXT1__ is not defined by the implementation. (#3151)

Follow-on to PR #3129.
  • Loading branch information
Ralf W. Grosse-Kunstleve authored Jul 28, 2021
1 parent 2164c2e commit f4721a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ template <typename type> class duration_caster {
};

inline std::tm *localtime_thread_safe(const std::time_t *time, std::tm *buf) {
#if defined(__STDC_WANT_LIB_EXT1__) || defined(_MSC_VER)
#if (defined(__STDC_LIB_EXT1__) && defined(__STDC_WANT_LIB_EXT1__)) || defined(_MSC_VER)
if (localtime_s(buf, time))
return nullptr;
return buf;
Expand Down

0 comments on commit f4721a7

Please sign in to comment.