On Sun, 20 Apr 2025 at 10:03, ZENG Hao wrote:
>
> When building for 'i386-*' targets, all basic types are 'sometimes lock-free'
> and thus std::atomic_signed_lock_free and std::atomic_unsigned_lock_free are
> not declared. In the header <atomic>, they are placed in preprocessor
> condition __cpp_lib_atomic_lock_free_type_aliases. In module std, they should
> be the same.

Thanks for the patch. I'll push this to trunk, but I don't think it's
urgent for GCC 15.1 so I will do the backport for the 15.2 release.


>
> libstdc++-v3/ChangeLog:
>
>         * src/c++23/std.cc.in: Add preprocessor condition
>         __cpp_lib_atomic_lock_free_type_aliases for
>         std::atomic_signed_lock_free and std::atomic_unsigned_lock_free.
> ---
>  libstdc++-v3/src/c++23/std.cc.in | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libstdc++-v3/src/c++23/std.cc.in 
> b/libstdc++-v3/src/c++23/std.cc.in
> index 5e18ad73908..ea50496b057 100644
> --- a/libstdc++-v3/src/c++23/std.cc.in
> +++ b/libstdc++-v3/src/c++23/std.cc.in
> @@ -599,7 +599,9 @@ export namespace std
>    using std::atomic_schar;
>    using std::atomic_short;
>    using std::atomic_signal_fence;
> +#ifdef __cpp_lib_atomic_lock_free_type_aliases
>    using std::atomic_signed_lock_free;
> +#endif
>    using std::atomic_size_t;
>    using std::atomic_store;
>    using std::atomic_store_explicit;
> @@ -622,7 +624,9 @@ export namespace std
>    using std::atomic_uintptr_t;
>    using std::atomic_ullong;
>    using std::atomic_ulong;
> +#ifdef __cpp_lib_atomic_lock_free_type_aliases
>    using std::atomic_unsigned_lock_free;
> +#endif
>    using std::atomic_ushort;
>    using std::atomic_wait;
>    using std::atomic_wait_explicit;
> --
> 2.49.0
>

Reply via email to