Skip to content

Commit 05852fb

Browse files
rwgkhenryiii
authored andcommitted
Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. (pybind#3151)
Follow-on to PR pybind#3129.
1 parent ed5fb66 commit 05852fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/chrono.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ template <typename type> class duration_caster {
101101
};
102102

103103
inline std::tm *localtime_thread_safe(const std::time_t *time, std::tm *buf) {
104-
#if defined(__STDC_WANT_LIB_EXT1__) || defined(_MSC_VER)
104+
#if (defined(__STDC_LIB_EXT1__) && defined(__STDC_WANT_LIB_EXT1__)) || defined(_MSC_VER)
105105
if (localtime_s(buf, time))
106106
return nullptr;
107107
return buf;

0 commit comments

Comments
 (0)