[libcxx-commits] [PATCH] D97870: [libc++] Add missing header <cuchar>
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Feb 7 12:18:48 PST 2022
ldionne added inline comments.
================
Comment at: libcxx/include/cuchar:46-56
+#if !defined(_LIBCPP_CXX03_LANG)
+
+using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
+using ::size_t _LIBCPP_USING_IF_EXISTS;
+
+using ::mbrtoc16 _LIBCPP_USING_IF_EXISTS;
+using ::c16rtomb _LIBCPP_USING_IF_EXISTS;
----------------
Quuxplusone wrote:
> Looking at how libc++ does its `cwctype` and `wctype.h`, I suspect you ought to do something isomorphic over here and wrap all this in `#if defined(_LIBCPP_INCLUDED_C_LIBRARY_UCHAR_H)`. (Or else explain in the commit summary why uchar.h's situation is different.)
Excellent point. I think we have the same problem, however the only declaration that can cause problems is `size_t`. So instead, if the platform doesn't provide <uchar.h>`, I'll include `<stddef.h>` so we get the definition of `size_t` and we don't cause problems when we do `using ::size_t _LIBCPP_USING_IF_EXISTS;`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97870/new/
https://reviews.llvm.org/D97870
More information about the libcxx-commits
mailing list