Remove more _Atomic keywords from public headers

It's been thirteen years and C++ still hasn't implemented this wonderful
simple builtin keyword. In C++23 a solution was provided for making this
work in C++ which is libcxx's stdatomic.h. Including that header schleps
in literally 253 unique header files!! Many of the header files it needs
are libc header files like pthread.h where we need to have the _Atomic()
keyword, but since <atomic> depends on pthreads we can't have it include
the <stdatomic.h> header that defines _Atomic for C++ users, and instead
we simply make the type non-atomic, hoping and praying only C code shall
use those internal data structures. This just shows how STL clowns can't
be trusted to define the innermost primitives of a language. They should
instead be focusing on being the best at algorithms and data structures.
This commit is contained in:
Justine Tunney 2024-07-24 13:34:15 -07:00
parent 4a1ae86124
commit 7ba9a73840
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
4 changed files with 4 additions and 49 deletions

View file

@ -27,7 +27,7 @@ enum {
typedef uintptr_t thrd_t;
typedef void (*tss_dtor_t)(void *);
typedef int (*thrd_start_t)(void *);
typedef _Atomic(uint32_t) once_flag;
typedef uint32_t once_flag;
void call_once(once_flag *, void (*)(void));
int thrd_create(thrd_t *, thrd_start_t, void *);