Re: [PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-06-01 Thread Jonathan Wakely
On Fri, 31 May 2024 at 16:52, Alexandre Oliva wrote: > > On May 31, 2024, Jonathan Wakely wrote: > > > On 31/05/24 11:07 -0300, Alexandre Oliva wrote: > >> --- a/libstdc++-v3/include/pstl/pstl_config.h > [...] > >> -#if defined(__clang__) > >> +#if defined(__GLIBCXX__) ? defined(_GLIBCXX_CLANG) :

Re: [PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-06-01 Thread Jonathan Wakely
On Sat, 1 Jun 2024 at 08:35, Olivier Hainque wrote: > > > > > On 31 May 2024, at 17:52, Alexandre Oliva wrote: > > >> Does the vxworks toolchain need to support the PSTL headers? > > > > Maybe we can do without them. I really don't know. Olivier? > > I have no indication that we can not-support

Re: [PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-06-01 Thread Olivier Hainque
> On 31 May 2024, at 17:52, Alexandre Oliva wrote: >> Does the vxworks toolchain need to support the PSTL headers? > > Maybe we can do without them. I really don't know. Olivier? I have no indication that we can not-support these. We are seeing many cases of C++/Ada combined codebases in

Re: [PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-05-31 Thread Alexandre Oliva
On May 31, 2024, Matthias Kretz wrote: > So __clang__ is turning into the next __GNUC__ ;) Yeah :-( > So passing -D__clang__=17 -D_GLIBCXX_CLANG=1 is possible? Should it be? I thought setting them independently could give us some testing flexibility, thought it's not for the faint of heart ;-)

Re: [PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-05-31 Thread Matthias Kretz
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

Re: [PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-05-31 Thread Alexandre Oliva
On May 31, 2024, Jonathan Wakely wrote: > On 31/05/24 11:07 -0300, Alexandre Oliva wrote: >> --- a/libstdc++-v3/include/pstl/pstl_config.h [...] >> -#if defined(__clang__) >> +#if defined(__GLIBCXX__) ? defined(_GLIBCXX_CLANG) : defined(__clang__) > This file is also imported from upstream, like

Re: [PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-05-31 Thread Jonathan Wakely
On 31/05/24 11:07 -0300, Alexandre Oliva wrote: A proprietary embedded operating system that uses clang as its primary compiler ships headers that require __clang__ to be defined. Defining that macro causes libstdc++ to adopt workarounds that work for clang but that break for GCC. So, introduc

[PATCH] [libstdc++] add _GLIBCXX_CLANG to workaround predefined __clang__

2024-05-31 Thread Alexandre Oliva
A proprietary embedded operating system that uses clang as its primary compiler ships headers that require __clang__ to be defined. Defining that macro causes libstdc++ to adopt workarounds that work for clang but that break for GCC. So, introduce a _GLIBCXX_CLANG macro, and a convention to tes