#endif /* !defined(__cpp_lib_chrono) && defined(__glibcxx_want_chrono) */
#undef __glibcxx_want_chrono
+#if !defined(__cpp_lib_chrono_cxx20)
+# if (__cplusplus >= 202002L)
+# define __glibcxx_chrono_cxx20 201800L
+# if defined(__glibcxx_want_all) || defined(__glibcxx_want_chrono_cxx20)
+# endif
+# endif
+#endif /* !defined(__cpp_lib_chrono_cxx20) && defined(__glibcxx_want_chrono_cxx20) */
+#undef __glibcxx_want_chrono_cxx20
+
#if !defined(__cpp_lib_execution)
# if (__cplusplus >= 201703L) && _GLIBCXX_HOSTED
# define __glibcxx_execution 201902L
#if __cpp_lib_bitops >= 201907L
# include <bit> // __countr_zero
#endif
-#if __cpp_lib_chrono >= 201803L && _GLIBCXX_HOSTED
+#ifdef __glibcxx_chrono_cxx20
+# include <bits/stl_algo.h> // upper_bound
+# include <bits/range_access.h> // begin/end for arrays
+#endif
+#if __cpp_lib_chrono >= 201803L // C++20 && HOSTED && USE_CXX11_ABI
# include <sstream>
# include <string>
# include <vector>
-# include <bits/stl_algo.h> // upper_bound
# include <bits/shared_ptr.h>
# include <bits/unique_ptr.h>
#endif
*/
namespace chrono
{
-#if __cpp_lib_chrono >= 201803L
+#ifdef __glibcxx_chrono_cxx20
/// @addtogroup chrono
/// @{
struct local_t { };
#endif // C++20
} // namespace chrono
-#if __cpp_lib_chrono >= 201803L
+#ifdef __glibcxx_chrono_cxx20
inline namespace literals
{
inline namespace chrono_literals
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#if __cpp_lib_chrono >= 201803L && _GLIBCXX_HOSTED
+#if defined __glibcxx_chrono_cxx20 && _GLIBCXX_HOSTED
# include <bits/chrono_io.h>
#endif
namespace chrono
{
-#if __cpp_lib_chrono >= 201803L && _GLIBCXX_HOSTED
+#if defined __glibcxx_chrono_cxx20 && _GLIBCXX_HOSTED
// TODO use CLOCK_TAI on linux, add extension point.
time_point<tai_clock>
tai_clock::now()