feat(libc): implement the std::__sce_v2 num_get virtuals for wchar_t integers, bool and pointers #16924
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16924"
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 Danigamer05 on 2026-11-07T22:54:50Z.
What
Builds on #16919: this branch contains its commits, and through it #16560, #16516, #16214, #16178 and #15923, with current
mainmerged in. Until they merge, only the last commit is this PR's change.Implement the same eight
do_getvirtuals ofstd::__sce_v2::num_get<wchar_t>that #16919 implements forchar:bool,unsigned short,unsigned int,long,unsigned long,long long,unsigned long longandvoid*. Before this PR, each of them threwNotImplemented_nid_no_patch. Thefloat,doubleandlong doubleslots still throw. These slots are not exports, so this PR adds no NID.The behavior comes from the
libc.prxbundled with PPSA03671 v01.001.005 (J03848509, SHA-256483961e086b8a1fffa8138b3c0badf798987fb5f35ec908d828946408be2d8a6), vtable0x18CDD0, field reader0xE3350. The module's wide functions follow the same steps as thecharones, so the code of #16919, already a template on the character type, is now instantiated for 16-bit characters too:0xa, reads two bytes from the get area and moves its pointer by two bytes.underflowanduflowend the input only on -1, so U+FFFF is a character.ctype<wchar_t>::widen, and every comparison, with them, with the thousands separator and with theboolnames, uses all 16 bits.numpunct<wchar_t>gives a 16-bit separator and 16-bit names, whilegroupingstays narrow.The
_Makelocandnum_getdebt entries now cover both facets.Tested
Windows 11, MinGW GCC 15.2, Release, head on top of #16919. Not run on Linux or macOS, not run in a title.
guest_sce_v2_num_get_wide: every implemented slot, characters whose low byte is a digit, a sign or the separator, U+FFFF from the get area and fromunderflow, the direct count, a held character, non-ASCII separators andboolnames, and digits from a replacedctype<wchar_t>. It passes, as doguest_sce_v2_num_get_char,guest_sce_v2_num_put_char,guest_sce_v2_num_put_wide,guest_sce_v2_char_facet_virtuals,guest_sce_v2_makeloc,guest_sce_v2_locale,guest_sce_v2_locale_basics,guest_sce_v2_locimp_references,guest_sce_v2_facet_ids,guest_locale,guest_sce_v2_exceptions,guest_sce_v2_string_to_integerandpublic_headers(14 of 14)._Makeloc, with 16-bit texts that mix ASCII, characters with a high byte and U+FFFF, random 16-bit separators, andboolnames with non-ASCII characters. It compares the same fields as forchar, with the get pointer in bytes._Sto*xredirected to this library's: 400,000 calls over 2 seeds, 0 differences._Sto*x: 200,000 calls, 0 differences.charregression on the harness of #16919: 100,000 calls, 0 differences.underflowresult, get area read, digit lookup, sign, separator,boolnames, end of input). The harness catches all 8. The first test run missed 3, so the test was strengthened and those were rerun: it now catches all 8 too.check_conventions,git diff --check: clean. Merges cleanly withmain.pr_overlapreports no open PR with the same functions; it could not compare 36 PRs that conflict withmainon shared files. Of those, the 5 that touchLocaleSupport.cpp(#7081, #9526, #11172, #12518, #12704) do not add these virtuals.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T12:24:51Z.
Review: COMMENTED
Reviewed — no blocking findings
The review artifacts and repository source were not accessible in this session, so the change could not be verified.
What I ran
Not run;
repo_read.pywas unavailable.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
The description, commits, diff, manifest, changed files, and repository context were not read. No checks were run.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:44:13Z.
Review: COMMENTED
I ran
guest_sce_v2_num_get_wideandguest_sce_v2_num_get_charwithc95d56ec56and its prerequisite stack integrated into a Linux release build. Both passed. The wide fixture exercises the integer, boolean and pointer slots added here, and the char fixture checks the stacked implementation alongside it.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.