[libcxx-commits] [libcxx] [libc++] Remove <stdbool.h> (PR #164595)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 24 01:24:54 PDT 2025


https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/164595

>From fed45bf28211d2cad784097d797a836eeccfc9c6 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Wed, 22 Oct 2025 12:32:53 +0200
Subject: [PATCH] [libc++] Remove <stdbool.h>

---
 libcxx/include/CMakeLists.txt      |  1 -
 libcxx/include/module.modulemap.in |  4 ---
 libcxx/include/stdbool.h           | 44 ------------------------------
 3 files changed, 49 deletions(-)
 delete mode 100644 libcxx/include/stdbool.h

diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 37259a7e6e7dd..47e21bfd42b2b 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -1063,7 +1063,6 @@ set(files
   sstream
   stack
   stdatomic.h
-  stdbool.h
   stddef.h
   stdexcept
   stdio.h
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index a86d6c6a43d0e..752b4cacd9c15 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -2434,10 +2434,6 @@ module std_stdatomic_h [system] {
   header "stdatomic.h"
   export *
 }
-module std_stdbool_h [system] {
-  // <stdbool.h>'s __bool_true_false_are_defined macro requires textual inclusion.
-  textual header "stdbool.h"
-}
 module std_stddef_h [system] {
   // <stddef.h> supports being included multiple times with different pre-defined macros
   textual header "stddef.h"
diff --git a/libcxx/include/stdbool.h b/libcxx/include/stdbool.h
deleted file mode 100644
index 768d08247256a..0000000000000
--- a/libcxx/include/stdbool.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_STDBOOL_H
-#define _LIBCPP_STDBOOL_H
-
-/*
-    stdbool.h synopsis
-
-Macros:
-
-    __bool_true_false_are_defined
-
-*/
-
-#if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-#  include <__cxx03/__config>
-#else
-#  include <__config>
-#endif
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#  pragma GCC system_header
-#endif
-
-#if __has_include_next(<stdbool.h>)
-#  include_next <stdbool.h>
-#endif
-
-#ifdef __cplusplus
-#  undef bool
-#  undef true
-#  undef false
-#  undef __bool_true_false_are_defined
-#  define __bool_true_false_are_defined 1
-#endif
-
-#endif // _LIBCPP_STDBOOL_H



More information about the libcxx-commits mailing list