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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 19 12:40:27 PDT 2022


philnik added a comment.

Thanks for working on this! Here are some comments, but this looks mostly good already.



================
Comment at: libcxx/include/__config:1214
 #    define _LIBCPP_PACKED_BYTE_FOR_AIX_END /* empty */
 #  endif
 
----------------
Does this complete the implementation of P0482R6? If yes, please update the status page and feature test macros. Otherwise, what is still missing?


================
Comment at: libcxx/include/cuchar:28-29
 
+size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps);   // C++20
+size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps);                     // C++20
 size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps);
----------------



================
Comment at: libcxx/include/cuchar:54-57
+#  if !defined(_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8)
+using ::mbrtoc8 _LIBCPP_USING_IF_EXISTS;
+using ::c8rtomb _LIBCPP_USING_IF_EXISTS;
+#  endif
----------------
I think this should also be guarded with `_LIBCPP_STD_VER >= 20`.


================
Comment at: libcxx/include/uchar.h:14
 /*
-    uchar.h synopsis // since C++11
+    uchar.h synopsis // since C11
 
----------------
As a C++ implementation we are interested in which C++ version something got added. So please use that version instead of in which C version something got added. Same for the rest of the synopsis.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130946



More information about the libcxx-commits mailing list