[clang] [clang][headers] Including stddef.h always redefines NULL (PR #99727)
Ian Anderson via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 22 12:40:09 PDT 2024
================
@@ -49,7 +48,25 @@
#define __need_rsize_t
#endif
#define __need_wchar_t
+#if !defined(__STDDEF_H) && !__building_module(_Builtin_stddef)
----------------
ian-twilightcoder wrote:
clang/test/Modules/stddef.cpp shows how even if we've already had a full include of the entirety of `<stddef.h>`, we still `__need` everything. It also shows that you're right and `__building_module(_Builtin_stddef)` doesn't work, but `__has_feature(modules)` does.
https://github.com/llvm/llvm-project/pull/99727
More information about the cfe-commits
mailing list