-
Notifications
You must be signed in to change notification settings - Fork 15k
[libc++] Remove <stdbool.h> #164595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[libc++] Remove <stdbool.h> #164595
Conversation
|
@llvm/pr-subscribers-libcxx Author: Nikolas Klauser (philnik777) Changes
Full diff: https://github.com/llvm/llvm-project/pull/164595.diff 4 Files Affected:
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index dd1e71380e7fc..f437f56154963 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
@@ -1651,7 +1650,6 @@ set(files
__cxx03/sstream
__cxx03/stack
__cxx03/stdatomic.h
- __cxx03/stdbool.h
__cxx03/stddef.h
__cxx03/stdexcept
__cxx03/stdint.h
diff --git a/libcxx/include/__cxx03/stdbool.h b/libcxx/include/__cxx03/stdbool.h
deleted file mode 100644
index e6c2eae2cfd12..0000000000000
--- a/libcxx/include/__cxx03/stdbool.h
+++ /dev/null
@@ -1,40 +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___CXX03_STDBOOL_H
-#define _LIBCPP___CXX03_STDBOOL_H
-
-/*
- stdbool.h synopsis
-
-Macros:
-
- __bool_true_false_are_defined
-
-*/
-
-#include <__cxx03/__config>
-
-#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___CXX03_STDBOOL_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 c34853b97b854..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/stdbool.h>
-#else
-# include <__config>
-
-# 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 // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
-
-#endif // _LIBCPP_STDBOOL_H
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'd like to run a build on that patch before we land it just to quantify the amount of breakage it causes (if any). People who have non-standard include path setups might not always be adding search paths for compiler builtin headers, and this could potentially break them.
CC @llvm/libcxx-vendors
Edit: ref 163294811&163294997 for builds
5d7b1e5 to
fed45bf
Compare
I ran a global test; no issues detected over here. |
|
This change looks good from z/OS point of you. |
<stdbool.h>is provided by the compiler and both Clang and GCC provide C++-aware versions of these headers, making our own wrapper header entirely unnecessary.