[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
Tue Aug 2 21:51:03 PDT 2022


tahonermann updated this revision to Diff 449531.
tahonermann edited the summary of this revision.
tahonermann added a comment.

Replaced the `_LIBCPP_HAS_C8RTOMB_MBRTOC8` macro with a negated version, `_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8` to follow the existing patterns present for absent declarations of `fgetpos()`, `fsetpos()`, and `fgets()`.

Conditioned the `std` namespace declarations in `<cuchar>` on `_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8`. Though the declarations specify `_LIBCPP_USING_IF_EXISTS`, that magic only works with Clang; the declarations need to be appropriately conditioned for use/testing of libc++ with gcc.

Added test `libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp` to validate that `_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8` is correctly set for the C library under test.

Introduced a `TEST_HAS_NO_C8RTOMB_MBRTOC8` macro in `libcxx/test/support/test_macros.h`. Though not strictly necessary, this is consistent with the existence of `_LIBCPP_HAS_NO_FGETPOS_FSETPOS`.


Repository:
  rG LLVM Github Monorepo

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

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
  libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp
  libcxx/test/support/test_macros.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130946.449531.patch
Type: text/x-patch
Size: 6160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220803/03946f7c/attachment-0001.bin>


More information about the libcxx-commits mailing list