You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implements std::collate<wchar_t>::_Getcat (libc), which was a NotImplemented stub.
The C-locale char facet from a546bbe (collate<char>::_Getcat) is generalised over the character type: GuestLocale::BasicString<TChar> and BasicCollateVtable<TChar>, with String/CollateVtable kept as aliases. do_compare, do_transform and do_hash are templates; the char behaviour is unchanged and the existing guest_collate checks still pass.
The wide facet uses 16-bit guest wchar_t (char16_t, as elsewhere in libc):
do_compare orders units as unsigned values, matching libc's wcscoll in the C locale.
do_hash is the FNV-1a of the range's bytes, which is what Dinkumware's _Hash_seq((const unsigned char*)first, (last - first) * sizeof(_Elem)) gives for both facets; the char facet already matches it.
do_transform builds a basic_string<wchar_t> with the same 0x28-byte layout (7 inline characters) and the same sizing as the char facet; it throws on embedded nulls and at the 4096-byte large-allocation threshold (2047 characters), as the char facet does at 4095.
The stub's signature is corrected to match the char export: returns size_t (the category, 1) and takes const locale* (const Implementation* const*).
The wide behaviour was not compared with the console; this is recorded in TechnicalDebt next to the existing collate<char> entry.
Tested
Windows 11, WinLibs GCC 15.2.0 ucrt r7, Release, full build + ctest -j 8: 836/837 passed. The one failure, guest_sce_net, times out on a host DNS lookup in my environment and does not touch libc locale code. guest_collate now also covers the wide facet (unsigned ordering above U+00FF, byte-wise hash, inline/heap transform boundary at 7/8 characters, the 2046/2047 size limit, invalid ranges, reference counting and deletion). tools/check_conventions.py passes.
Checklist
Based on current main; no other open PR implements the same functions
Independent Linux check on PR head 8246a132: configured Release with GCC 12.2.0 and BUILD_TESTING=ON, built guest_collate_tests, then ran ctest --test-dir /tmp/AnyPS5-pr-3990-build -R "^guest_collate$" --output-on-failure. Result: 1/1 passed (0.04 s). This checks the registered test on Linux; it does not validate the Windows-specific layout behavior.
Independent Linux check on PR head 8246a132: configured Release with GCC 12.2.0 and BUILD_TESTING=ON, built guest_collate_tests, then ran ctest --test-dir /tmp/AnyPS5-pr-3990-build -R "^guest_collate$" --output-on-failure. Result: 1/1 passed (0.04 s). This checks the registered test on Linux; it does not validate the Windows-specific layout behavior.
Closing: same as #2333 and #1982. No title is shown to stop at collate<wchar_t>::_Getcat on main, and the wide facet hasn't been compared with the console. Reopen with the title ID and the log line when one does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements
std::collate<wchar_t>::_Getcat(libc), which was aNotImplementedstub.charfacet from a546bbe (collate<char>::_Getcat) is generalised over the character type:GuestLocale::BasicString<TChar>andBasicCollateVtable<TChar>, withString/CollateVtablekept as aliases.do_compare,do_transformanddo_hashare templates; thecharbehaviour is unchanged and the existingguest_collatechecks still pass.wchar_t(char16_t, as elsewhere in libc):do_compareorders units as unsigned values, matching libc'swcscollin the C locale.do_hashis the FNV-1a of the range's bytes, which is what Dinkumware's_Hash_seq((const unsigned char*)first, (last - first) * sizeof(_Elem))gives for both facets; thecharfacet already matches it.do_transformbuilds abasic_string<wchar_t>with the same 0x28-byte layout (7 inline characters) and the same sizing as thecharfacet; it throws on embedded nulls and at the 4096-byte large-allocation threshold (2047 characters), as thecharfacet does at 4095.charexport: returnssize_t(the category, 1) and takesconst locale*(const Implementation* const*).collate<char>entry.Tested
Windows 11, WinLibs GCC 15.2.0 ucrt r7, Release, full build +
ctest -j 8: 836/837 passed. The one failure,guest_sce_net, times out on a host DNS lookup in my environment and does not touch libc locale code.guest_collatenow also covers the wide facet (unsigned ordering above U+00FF, byte-wise hash, inline/heap transform boundary at 7/8 characters, the 2046/2047 size limit, invalid ranges, reference counting and deletion).tools/check_conventions.pypasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)