feat(libSceLibcInternal): implement the collate<wchar_t> members #15712
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15712"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-04T09:07:33Z.
What
Implements the six
std::collate<wchar_t>members thatlibSceLibcInternalexported asNotImplementedstubs (Err.cpp,Pending3_049..054):roztnFEs5Escollate<wchar_t>::do_compareWideCollateCompareZxe-nQMgxHMcollate<wchar_t>::do_transformWideCollateTransformcWaCDW+Dc9Ucollate<wchar_t>::do_hashWideCollateHashn-3HFZvDwBwcollate<wchar_t>::comparedo_compare81uX7PzrtG8collate<wchar_t>::transformdo_transformentYnoIu+fccollate<wchar_t>::hashdo_hashReferences:
compare"Returns:do_compare(low1, high1, low2, high2)", and likewisetransformreturnsdo_transform(low, high)andhashreturnsdo_hash(low, high). The public members therefore dispatch through the facet's vtable, as the existingcollate<char>::transforminLocaleSupport.cppalready does (reinterpret_cast<const GuestLocale::CollateVtable*>(self->base.vtable)->transform(...)).do_members are the base implementations thatcollate<wchar_t>::_Getcatalready installs in the facet (g_wideCollateVtable{..., WideCollateCompare, WideCollateTransform, WideCollateHash}, withGuestWideCharacterSize = 2). They call those functions directly, not through the vtable, so a derived facet that callscollate<wchar_t>::do_compareexplicitly cannot recurse into its own override. libc now exposes that vtable tolibSceLibcInternalthroughGuestWideCollateVtable_nid_no_patch(). It has no NID, so libc's export set does not change.The members are written in a new
WideCollate.cppwith their declarations ininclude/WideCollate.hpp, which keeps them away from the lines ofApi.hppthat other open PRs edit. Their six debt entries are removed fromdocs/dev/debt/libSceLibcInternal.md. Only the C locale gets a collate facet, as before:_Getcatstill throws for any other locale.tools/progress.pycollect_libraries(): done goes from 9913 to 9919 (+6) out of 37146 on origin/main5b1d381d5a. libSceLibcInternal goes from 92 done / 1045 todo to 98 / 1039. No new todo names.Tested
New guest test
guest_libc_internal_wide_collate(core/libs/tests/GuestLibcInternalWideCollate.cpp). It checks:do_members return the base results and never reach it;Runs, same tests on both platforms (
guest_libc_internal_wide_collate, plus the existingguest_collateandguest_localeas regressions):libSceLibcInternal.prxon Windows exports all six<NID>_nid_no_patch_cutsymbols and importsGuestWideCollateVtable_nid_no_patchfrom libc.Err.cppand withoutWideCollate.cppbuilt in, the new test fails to link (undefined reference to sceLibcInternalWideCollateDoCompare_nid_no_patch, and the other five).python3 tools/check_conventions.py --base origin/main: all checks passed. Theconventions_*anddebt_splitCTest entries are self-tests of the checker scripts, not of this change, and were not run here.python3 tools/pr_overlap.py --branch feat/r2-collate-wchar: no open PR implements these exports or adds these files, andgit merge-treeagainst PR 15695 and PR 15696, the two that edit nearby lines of the libSceLibcInternalCMakeLists.txt, merges cleanly. It fails closed only because some older PRs that touchLocaleSupport.cpp,GuestLocale.hpp, the libSceLibcInternalCMakeLists.txtor its debt file conflict with main, so those files could not be compared automatically.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code