[libcxx-commits] [PATCH] D130946: [libc++][cuchar] Declare std::c8rtomb and std::mbrtoc8 in <cuchar> if available.

Tom Honermann via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 1 14:58:27 PDT 2022


tahonermann created this revision.
tahonermann added reviewers: ldionne, libc++.
tahonermann added a project: libc++.
Herald added a project: All.
tahonermann requested review of this revision.
Herald added 1 blocking reviewer(s): libc++.

This change implements the C library dependent portions of P0482R6 (char8_t: A type for UTF-8 characters and strings (Revision 6)) by declaring std::c8rtomb() and std::mbrtoc8() in the <cuchar> header when implementations are provided by the C library as specified by WG14 N2653 (char8_t: A type for UTF-8 characters and strings (Revision 1)) as adopted for C23.

A _LIBCPP_HAS_C8RTOMB_MBRTOC8 macro is defined by the libc++ __config header if the C library is known to provide these functions. This macro is used for testing purposes and may be of use to libc++ users. At present, the only C library known to implement these functions is glibc as of its 2.36 release.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130946

Files:
  libcxx/include/__config
  libcxx/include/cuchar
  libcxx/include/uchar.h
  libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp
  libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130946.449137.patch
Type: text/x-patch
Size: 3934 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220801/3088a75e/attachment.bin>


More information about the libcxx-commits mailing list