feat(libSceLibcInternal): implement messages<char> and messages<wchar_t>::_Getcat #24942
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24942"
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 GiannisG1 on 2026-11-21T11:54:36Z.
What
With #23867 in, every
messages<char>andmessages<wchar_t>constructor form is implemented. The two_Getcatexports of the class were still inventory placeholders that threw:messages<char>::_Getcat(const locale::facet**, const locale*)96Ev+CE1luEmessages<wchar_t>::_Getcat(const locale::facet**, const locale*)XghI4vmw8mU_Getcatis the factory thatuse_facetand the locale constructors call for a facet the locale doesn't have yet. microsoft/STL'sxlocmesdefines it as: if the slot is non-null and empty, storenew messages<_Elem>(_Locinfo(_Ploc->_C_str())); always return_X_MESSAGES, which is 6 inxlocinfo. The other_Getcatexports here use the same numbering:num_getreturns 4 andtime_get5.In
Messages.cpp, both exports share one helper. For an empty slot, it allocates the facet withoperator newand builds it through the same path as the(const char*, size_t)constructor, using the locale's name and no references. A guard frees the allocation if construction throws, so the slot stays empty. A filled slot is left alone, and a null slot only returns the category. An empty slot with a null locale throwsstd::invalid_argument, because the STL code would dereference it.The mangled names hash to the inventory NIDs (
tools/nid_names.py), so the exports are named and the two placeholders are gone. The debt fragment removes the two table rows and adds a Functional entry: not verified on a console.Tested
Linux Mint 22.3, GCC 13.3.0, Release,
-DANYPS5_ENABLE_SPIRV_TOOLS=ONas inmain's Linux job, head onmain0ac196e295.guest_libc_internal_messagesgetsCheckGetcat, which checks both exports:messages<char>vtable, or the wide one) and no references, and the call returns 6;_Getcatreturning 5 instead of 6, the test aborts atmessages<char>::_Getcat builds a facet for an empty slot and returns the messages category. With the change it passes 3/3.progress.py --module libSceLibcInternal: 641 → 643 implemented. The two placeholders leave the pending list, and nothing joins it.tools/suite.py -j2) on this branch: GPU tests on a GTX 1050 Ti (NVIDIA 580.178.04), an HD 630 (Mesa 25.2.8 ANV) and llvmpipe 25.2.8, everything else once. The failures and skips are the same as ourmain0ac196e295run with the same configuration: GTX 0, HD 630 the same 8 (#20831, #16953, our #22078, and the two real-display presents pluswindow_margins_boundsunder Xvfb), and llvmpipe the same 3 (Mesa 25.2.8, #24834).guest_libc_internal_messagesand the 152 source-scanning tests (conventions,public_headers,tools_*) pass.check_conventions.py,check_test_registration.py,check_compile.py,check_main_sync.py(merges cleanly with26194f0fcf) anddebt_fold.py --checkare clean.pr_overlap.py --branch: no overlap among the pull requests it could compare. #13778, #17300, #18135 and #19602 could not be compared, because they conflict withmain. In their diffs, #17300 removes the neighbouring placeholders 149 and 153/154, next to the 150 and 155 removed here, so whichever lands second keeps both removals. #13778 and #19602 remove other placeholders, and #18135 only adds declarations elsewhere inApi.hpp.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T12:16:09Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed implementation and focused test support merging.
What I ran
Reviewed head
0a94a32d495da9035e17bbc67b5935e2cfbf148busing the prepared diff and pinned repository reader. No commands or tests were run by me; reported test results are author supplied.Results
guest_libc_internal_messagespassedFindings
Blocking
None.
Non-blocking
None.
Not verified
The full source of
core/libs/prx/libSceLibcInternal/InventoryExports.cppwas not read; its changed hunk only removes the two inventory placeholders.review/files.jsonwas unavailable through the reader, so there were no additional excluded-file details to inspect. The author-reported test suite, build and console behavior were not independently run or confirmed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-21T12:31:25Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0a94a32d49:tools/check_conventions.pypassed.guest_libc_internal_messages_testsbuilt cleanly.guest_libc_internal_messages):core/libs/prx/libSceLibcInternal/InventoryExports.cpp,core/libs/prx/libSceLibcInternal/Messages.cpp,core/libs/prx/libSceLibcInternal/include/Api.hpp,core/libs/prx/libSceLibcInternal/include/InventoryExports.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me