https://github.com/tru updated https://github.com/llvm/llvm-project/pull/232746
>From 19ef14a2e3b80cb537b6461639ab0d504201d8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= <[email protected]> Date: Fri, 16 Oct 2026 15:28:54 +0200 Subject: [PATCH] [libcxx] fix missing `__get_locale_encoding()` for OpenBSD (#228306) Fixes errors like this: /home/alexrp/Sources/ziglang/zig-llvm23/lib/libcxx/src/text_encoding.cpp:34:43: error: no member named '__get_locale_encoding' in namespace 'std::__locale' 34 | return __make_text_encoding(__locale::__get_locale_encoding(static_cast<__locale::__locale_t>(0))); | ^~~~~~~~~~~~~~~~~~~~~ /home/alexrp/Sources/ziglang/zig-llvm23/lib/libcxx/src/text_encoding.cpp:48:41: error: no member named '__get_locale_encoding' in namespace 'std::__locale' 48 | return __make_text_encoding(__locale::__get_locale_encoding(__l)); | ^~~~~~~~~~~~~~~~~~~~~ 2 errors generated. (cherry picked from commit 19f123540bfc1dc55f93d4dc22a3276b434f6cc4) --- libcxx/include/__locale_dir/support/openbsd.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libcxx/include/__locale_dir/support/openbsd.h b/libcxx/include/__locale_dir/support/openbsd.h index 0ec5b12f2ebdde..57cb0d76174da1 100644 --- a/libcxx/include/__locale_dir/support/openbsd.h +++ b/libcxx/include/__locale_dir/support/openbsd.h @@ -24,6 +24,9 @@ # include <wchar.h> # include <wctype.h> #endif +#if defined(_LIBCPP_BUILDING_LIBRARY) +# include <langinfo.h> +#endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header @@ -74,6 +77,10 @@ inline __lconv_t* __localeconv(__locale_t& __loc) { __locale_guard __current(__loc); return ::localeconv(); } + +inline _LIBCPP_HIDE_FROM_ABI const char* __get_locale_encoding(__locale_t __loc) { + return ::nl_langinfo_l(CODESET, __loc); +} #endif // _LIBCPP_BUILDING_LIBRARY // _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
