commit:     66e18dd329f4728409abced4138562a079b30ccd
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 12 15:43:49 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 12 16:34:09 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66e18dd3

toolchain-funcs.eclass: update tc-get-cxx-stdlib for C++20

<ciso646> is gone from C++20, so use <version> for >= C++20.

See https://stackoverflow.com/a/31658120.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain-funcs.eclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index ae21a18a14c2..baf032bbd4ec 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1156,7 +1156,12 @@ tc-enables-ssp-all() {
 #
 # If the library is not recognized, the function returns 1.
 tc-get-cxx-stdlib() {
-       local code='#include <ciso646>
+       local code='
+#if __cplusplus >= 202002L
+       #include <version>
+#else
+       #include <ciso646>
+#endif
 
 #if defined(_LIBCPP_VERSION)
        HAVE_LIBCXX

Reply via email to