[libc-commits] [libc] [libc] Add wcsxfrm (PR #191692)

Victor Campos via libc-commits libc-commits at lists.llvm.org
Wed Apr 15 01:56:39 PDT 2026


================
@@ -0,0 +1,51 @@
+//===-- Implementation of wcsxfrm ----------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/wchar/wcsxfrm.h"
+
+#include "src/__support/common.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+// TODO: Add support for locale-aware collation keys.
+// For now, this implements C/POSIX-like behavior: the transformed form is the
+// original wide string itself, so comparing transformed strings with wcscmp
+// matches code-point order.
+LLVM_LIBC_FUNCTION(size_t, wcsxfrm,
----------------
vhscampos wrote:

AFAIK in order to use `size_t`, you must include `hdr/types/size_t.h`. Likewise for `wchar_t`. Remember also to add these headers as dependencies in CMake.

See https://libc.llvm.org/dev/code_style.html#header-inclusion-policy

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


More information about the libc-commits mailing list