https://gcc.gnu.org/g:dcc14761f34f9a9c8a6ed8f0f4e276fa8ef4d950

commit r16-1078-gdcc14761f34f9a9c8a6ed8f0f4e276fa8ef4d950
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Mon Jun 2 23:25:43 2025 +0100

    libstdc++: Check feature test macro for jthread in <stop_token>
    
    Check the appropriate feature test macro instead of checking that
    __cplusplus >= 201703L.
    
    libstdc++-v3/ChangeLog:
    
            * include/std/stop_token: Check __glibcxx_jthread instead of
            __cplusplus.

Diff:
---
 libstdc++-v3/include/std/stop_token | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/include/std/stop_token 
b/libstdc++-v3/include/std/stop_token
index 1225b3afd275..775ec6aa207d 100644
--- a/libstdc++-v3/include/std/stop_token
+++ b/libstdc++-v3/include/std/stop_token
@@ -34,8 +34,7 @@
 #define __glibcxx_want_jthread
 #include <bits/version.h>
 
-#if __cplusplus > 201703L
-
+#ifdef __glibcxx_jthread // C++ >= 20
 #include <atomic>
 #include <bits/std_thread.h>
 
@@ -650,6 +649,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;
 
 _GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-#endif // __cplusplus > 201703L
+} // namespace std
+#endif // __glibcxx_jthread
 #endif // _GLIBCXX_STOP_TOKEN

Reply via email to