From 35e819c71b5e730375c226c9e12b5ee016d5fb15 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 28 Jul 2021 05:07:58 -0700 Subject: [PATCH] Accommodating environments that define __STDC_WANT_LIB_EXT1__ even if __STDC_LIB_EXT1__ is not defined by the implementation. Follow-on to PR #3129. --- include/pybind11/chrono.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/chrono.h b/include/pybind11/chrono.h index c4e81f5720..61bbcbc540 100644 --- a/include/pybind11/chrono.h +++ b/include/pybind11/chrono.h @@ -101,7 +101,7 @@ template 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;