aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZENG Hao <c@cyano.cn>2025-04-20 17:02:16 +0800
committerJonathan Wakely <redi@gcc.gnu.org>2025-05-06 12:53:53 +0100
commitf2a69ee64f8b663d14649b7475edb8e09e83db1b (patch)
tree446e064bc62eb3b4d463a7eec2b8b8d47b485337
parenta14d65f81e18e70144ceddfc3142a8103984919d (diff)
downloadgcc-f2a69ee64f8b663d14649b7475edb8e09e83db1b.zip
gcc-f2a69ee64f8b663d14649b7475edb8e09e83db1b.tar.gz
gcc-f2a69ee64f8b663d14649b7475edb8e09e83db1b.tar.bz2
libstdc++: fix possible undefined atomic lock-free type aliases in module std
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. libstdc++-v3/ChangeLog: * src/c++23/std.cc.in (atomic_signed_lock_free): Guard with preprocessor check for __cpp_lib_atomic_lock_free_type_aliases. (atomic_unsigned_lock_free): Likewise. (cherry picked from commit 466c80a885ccbd5186cd57b0785cf38b8cf2ff2f)
-rw-r--r--libstdc++-v3/src/c++23/std.cc.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/libstdc++-v3/src/c++23/std.cc.in b/libstdc++-v3/src/c++23/std.cc.in
index 6da6d38..930a489 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;