libstdc++: Define <stdatomic.h> for C++23
authorJonathan Wakely <jwakely@redhat.com>
Mon, 17 Jan 2022 14:43:24 +0000 (14:43 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 18 Jan 2022 16:31:02 +0000 (16:31 +0000)
commitd7f2a09e98520c4e4927f460ad96803b05a205b1
treebd809c3eaedb69416489e908b63c008ccafec443
parent58385f6ace42d17da5a73cb9b68ce6173295840f
libstdc++: Define <stdatomic.h> for C++23

This adds the C++23 <stdatomic.h> header, as proposed by P0943R6, for
compatibility with C code.

There are still some ABI differences between atomic_xxx in C and C++
std::atomic_xxx in C++, so this only provides source compatibility, not
binary compatibility.

libstdc++-v3/ChangeLog:

* include/Makefile.am: Install new header.
* include/Makefile.in: Regenerate.
* include/c_compatibility/stdatomic.h: New file.
* testsuite/29_atomics/headers/stdatomic.h/c_compat.cc: New test.
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/c_compatibility/stdatomic.h [new file with mode: 0644]
libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/c_compat.cc [new file with mode: 0644]