On Tue, 26 Aug 2025 at 18:31, Nathan Myers wrote:
> --- a/libstdc++-v3/include/std/chrono
> +++ b/libstdc++-v3/include/std/chrono
> @@ -22,6 +22,8 @@
>  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  // <http://www.gnu.org/licenses/>.
>
> +// [time]
> +
>  /** @file include/chrono
>   *  This is a Standard C++ Library header.
>   *  @ingroup chrono
> @@ -42,12 +44,16 @@
>  # include <bits/c++0x_warning.h>
>  #else
>
> +#define __glibcxx_want_chrono
> +#define __glibcxx_want_chrono_udls
> +#include <bits/version.h>
> +
>  #include <bits/chrono.h>
>
> -#if __cplusplus >= 202002L
> +#if __cpp_lib_bitops >= 201907L
>  # include <bit> // __countr_zero
>  #endif
> -#if __cplusplus >= 202002L && _GLIBCXX_HOSTED
> +#if __cpp_lib_chrono >= 201803L && _GLIBCXX_HOSTED

N.B. this #if check is redundant here (but harmless).

The src/c++20/clock.cc file is compiled with -std=gnu++20 so the
feature test macro is defined, and is not compiled at all when
--disable-libstdcxx-hosted is used, so it's always hosted.

It doesn't hurt to keep the check though, for consistency with the
declarations in the header.

Reply via email to