[libc-commits] [libc] Add <stdbool.h> to llvm-libc-types headers that need it. (PR #165798)

via libc-commits libc-commits at lists.llvm.org
Thu Oct 30 16:20:30 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Alexey Samsonov (vonosmas)

<details>
<summary>Changes</summary>

We need `<stdbool.h>` to support having "bool" members inside pthread structs that may get included through `<pthread.h>` from C code prior to C23.

---
Full diff: https://github.com/llvm/llvm-project/pull/165798.diff


2 Files Affected:

- (modified) libc/include/llvm-libc-types/__barrier_type.h (+2) 
- (modified) libc/include/llvm-libc-types/pthread_barrierattr_t.h (+2) 


``````````diff
diff --git a/libc/include/llvm-libc-types/__barrier_type.h b/libc/include/llvm-libc-types/__barrier_type.h
index 59712619e917d..5752f832f04b9 100644
--- a/libc/include/llvm-libc-types/__barrier_type.h
+++ b/libc/include/llvm-libc-types/__barrier_type.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_LIBC_TYPES__BARRIER_TYPE_H
 #define LLVM_LIBC_TYPES__BARRIER_TYPE_H
 
+#include <stdbool.h>
+
 typedef struct __attribute__((aligned(8 /* alignof (Barrier) */))) {
   unsigned expected;
   unsigned waiting;
diff --git a/libc/include/llvm-libc-types/pthread_barrierattr_t.h b/libc/include/llvm-libc-types/pthread_barrierattr_t.h
index 064be5bfb6721..b62fdc0f72e12 100644
--- a/libc/include/llvm-libc-types/pthread_barrierattr_t.h
+++ b/libc/include/llvm-libc-types/pthread_barrierattr_t.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_LIBC_TYPES_PTHREAD_BARRIERATTR_T_H
 #define LLVM_LIBC_TYPES_PTHREAD_BARRIERATTR_T_H
 
+#include <stdbool.h>
+
 typedef struct {
   bool pshared;
 } pthread_barrierattr_t;

``````````

</details>


https://github.com/llvm/llvm-project/pull/165798


More information about the libc-commits mailing list