[libcxx-commits] [libcxx] [libc++] stddef.h needs to #include_next for the new clang __need_ macros (PR #86252)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 21 23:48:14 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Ian Anderson (ian-twilightcoder)
<details>
<summary>Changes</summary>
clang added several __need_ macros to stddef.h that need to be added to the libc++ version as well. clang will also re-enter stddef.h to define rsize_t if __STDC_WANT_LIB_EXT1__ is set, do that in the libc++ one too.
---
Full diff: https://github.com/llvm/llvm-project/pull/86252.diff
1 Files Affected:
- (modified) libcxx/include/stddef.h (+4-3)
``````````diff
diff --git a/libcxx/include/stddef.h b/libcxx/include/stddef.h
index 887776b150e49d..a3acf0ff10d1b6 100644
--- a/libcxx/include/stddef.h
+++ b/libcxx/include/stddef.h
@@ -7,8 +7,9 @@
//
//===----------------------------------------------------------------------===//
-#if defined(__need_ptrdiff_t) || defined(__need_size_t) || defined(__need_wchar_t) || defined(__need_NULL) || \
- defined(__need_wint_t)
+#if defined(__need_ptrdiff_t) || defined(__need_size_t) || defined(__need_rsize_t) || defined(__need_wchar_t) || \
+ defined(__need_NULL) || defined(__need_nullptr_t) || defined(__need_unreachable) || defined(__need_max_align_t) || \
+ defined(__need_offsetof) || defined(__need_wint_t)
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -16,7 +17,7 @@
# include_next <stddef.h>
-#elif !defined(_LIBCPP_STDDEF_H)
+#elif !defined(_LIBCPP_STDDEF_H) || (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1)
# define _LIBCPP_STDDEF_H
/*
``````````
</details>
https://github.com/llvm/llvm-project/pull/86252
More information about the libcxx-commits
mailing list