So __clang__ is turning into the next __GNUC__ ;) In essence, inside libstdc++ code, __clang__ is going to mean Clang-compatible compiler and _GLIBCXX_CLANG then means it's the actual Clang compiler (or a vendor variant like Apple's). Would it make sense to adjust the Apple clang major version then so that it matches the LLVM major versions? (e.g. https:// stackoverflow.com/a/78014367)
More inline. On Friday, 31 May 2024 16:50:26 GMT+2 Jonathan Wakely wrote: > >diff --git a/libstdc++-v3/include/bits/c++config > >b/libstdc++-v3/include/bits/c++config index b57e3f338e92a..6dca2d9467aa5 > >100644 > >--- a/libstdc++-v3/include/bits/c++config > >+++ b/libstdc++-v3/include/bits/c++config > >@@ -481,9 +481,20 @@ _GLIBCXX_END_NAMESPACE_VERSION > > > > // Define if compatibility should be provided for -mlong-double-64. > > #undef _GLIBCXX_LONG_DOUBLE_COMPAT > > > >+// Use an alternate macro to test for clang, so as to provide an easy > >+// workaround for systems (such as vxworks) whose headers require > >+// __clang__ to be defined, even when compiling with GCC. > >+#if !defined _GLIBCXX_CLANG && defined __clang__ > >+# define _GLIBCXX_CLANG __clang__ > >+// Turn -D_GLIBCXX_CLANG=0 into -U_GLIBCXX_CLANG, so that > >+// _GLIBCXX_CLANG can be tested as defined, just like __clang__. > >+#elif !_GLIBCXX_CLANG > >+# undef _GLIBCXX_CLANG > >+#endif > >+ So passing -D__clang__=17 -D_GLIBCXX_CLANG=1 is possible? Should it be? > >diff --git a/libstdc++-v3/include/experimental/bits/simd.h > >b/libstdc++-v3/include/experimental/bits/simd.h index > >7c52462571902..ea034138fd720 100644 > >--- a/libstdc++-v3/include/experimental/bits/simd.h > >+++ b/libstdc++-v3/include/experimental/bits/simd.h > >@@ -606,7 +606,7 @@ template <size_t _Bytes> > > > > static_assert(_Bytes > 0); > > if constexpr (_Bytes == sizeof(int)) > > > > return int(); > > > >- #ifdef __clang__ > >+ #ifdef _GLIBCXX_CLANG > > I'd like to hear from Matthias to know he's OK with the simd changes. Yes, LGTM. There's no maintained upstream copy of simd anymore. And all occurrences in the simd code are asking for the actual Clang compiler. -Matthias -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Center for Heavy Ion Research https://gsi.de std::simd ──────────────────────────────────────────────────────────────────────────
signature.asc
Description: This is a digitally signed message part.