[libcxx-commits] [PATCH] D131425: [libc++] Remove workarounds for systems with tortuous include requirements

Alexander Richardson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 22 02:00:22 PST 2022


arichardson added inline comments.


================
Comment at: libcxx/include/stddef.h:37
+#if __has_include_next(<stddef.h>)
+    // The Clang builtin headers only define the types we need when we request it explicitly.
+    // TODO: We should fix that in Clang and drop these defines.
----------------
I don't believe this is true: running `clang -nostdinc -P -E ~/llvm-project/clang/lib/Headers/stddef.h` gives me the following output:

```
typedef long int ptrdiff_t;
typedef long unsigned int size_t;
typedef int wchar_t;
typedef struct {
  long long __clang_max_align_nonce1
      __attribute__((__aligned__(__alignof__(long long))));
  long double __clang_max_align_nonce2
      __attribute__((__aligned__(__alignof__(long double))));
} max_align_t;
```

And running with `-dD` shows that `NULL` is also defined.

The only thing that explicitly needs a `__need` macro appears to be `__need_wint_t` (added in rGa8792e514a4e271a61b8cc7e3e39485fb00af2bf)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131425/new/

https://reviews.llvm.org/D131425



More information about the libcxx-commits mailing list