[libcxx-commits] [libcxx] [libcxx] Define _LIBCPP_HAS_C8RTOMB_MBRTOC8 for picolibc (PR #152724)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 15 02:19:10 PDT 2025


================
@@ -1021,14 +1021,27 @@ typedef __char32_t char32_t;
 // the latter depends on internal GNU libc details that are not appropriate
 // to depend on here, so any declarations present when __cpp_char8_t is not
 // defined are ignored.
+//
+// picolibc 1.8.9 and newer declare the two functions unconditionally.
+//
+// Apple C library, Microsoft C Runtime, AIX C library and FreeBSD libc do not
+// yet support these functions.
 #  if defined(_LIBCPP_GLIBC_PREREQ)
-#    if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)
+#    if defined(__cpp_char8_t) && _LIBCPP_GLIBC_PREREQ(2, 36)
 #      define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
 #    else
 #      define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
 #    endif
-#  else
+#  elif defined(_LIBCPP_PICOLIBC_PREREQ)
+#    if _LIBCPP_PICOLIBC_PREREQ(1, 8, 9)
+#      define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
+#    else
+#      define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
+#    endif
----------------
philnik777 wrote:

AFAIK we don't support multiple versions of picolibc.

https://github.com/llvm/llvm-project/pull/152724


More information about the libcxx-commits mailing list