Skip to content

Commit 8d87631

Browse files
committed
Refactor the preprocessor logic
1 parent b606497 commit 8d87631

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libcxx/include/__config

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,18 +1021,22 @@ typedef __char32_t char32_t;
10211021
// the latter depends on internal GNU libc details that are not appropriate
10221022
// to depend on here, so any declarations present when __cpp_char8_t is not
10231023
// defined are ignored.
1024+
//
1025+
// picolibc 1.8.9 and newer declare the two functions unconditionally.
10241026
# if defined(_LIBCPP_GLIBC_PREREQ)
1025-
# if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)
1027+
# if defined(__cpp_char8_t) && _LIBCPP_GLIBC_PREREQ(2, 36)
10261028
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
10271029
# else
10281030
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
10291031
# endif
10301032
# elif defined(_LIBCPP_PICOLIBC_PREREQ)
1031-
# if _LIBCPP_PICOLIBC_PREREQ(1, 8, 9) && defined(__cpp_char8_t)
1033+
# if _LIBCPP_PICOLIBC_PREREQ(1, 8, 9)
10321034
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
10331035
# else
10341036
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
10351037
# endif
1038+
# else
1039+
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
10361040
# endif
10371041

10381042
// There are a handful of public standard library types that are intended to

0 commit comments

Comments
 (0)