Use of stdatomic.h is undefined in C++, even the C++ 2020 standard does not
list stdatomic.h as a C library header supported by the language. More,
there are some subtle differences between the <atomic> C++ header, and
C11+ stdatomic.h provided features.
Nonetheless, it is a quality of the implementation aspect, so let mis-users
mis-use stdatomic.h as they want, by making a compat shim for _Bool.
PR: 262683
Reported by: yuri
Reviewed by: dim, emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34686
#endif
}
+#if defined(__cplusplus) && !defined(_Bool)
+#define _Bool bool
+#define __bool_locally_defined
+#endif
+
/*
* 7.17.5 Lock-free property.
*/
}
#endif /* !_KERNEL */
+#ifdef __bool_locally_defined
+#undef _Bool
+#undef __bool_locally_defined
+#endif
+
#endif /* !_STDATOMIC_H_ */