On Thu, 3 Feb 2022 at 20:27, Ron Olson <tachoknight(a)gmail.com> wrote:
Here’s a question: what if the following was added to stdatomic.h at the end of the
file:
#else
#include_next <stdatomic.h>
#endif // C++23
Since the rest of the file is gated by C++23, this allows C++ programs that reference
this header to have a chance to pick up the Clang one, if it exists. If Clang isn’t
installed, it doesn’t matter insofar as the C++ program is going to fail anyway because it
hasn’t explicitly set -std=c++2b.
That will fail miserably with GCC, because the C library's
<stdatomic.h> cannot be included in C++ (because it uses C features
that are not valid in C++).
But I'll test:
#elif defined __clang__
#include_next <stdatomic.h>