]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Check feature test macro for jthread in <stop_token>
authorJonathan Wakely <jwakely@redhat.com>
Mon, 2 Jun 2025 22:25:43 +0000 (23:25 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 3 Jun 2025 10:24:15 +0000 (11:24 +0100)
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.

libstdc++-v3/include/std/stop_token

index 1225b3afd2758bfef593ce748438bf42d25b8148..775ec6aa207dde6f19d77bbca4c07c86dde0f81d 100644 (file)
@@ -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