feat(libSceIcu): give six ucal and udat exports their ICU 68.2 signatures and early returns #23839
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23839"
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 ToRaNek on 2026-11-19T18:37:29Z.
What
Six calendar and date format exports of libSceIcu were parameterless
intplaceholders inRecoveredInventory.cppthat threw on every call:ucal_getAttribute,ucal_getDayOfWeekType,ucal_openTimeZoneIDEnumeration,ucal_openTimeZones,udat_countSymbolsandudat_getCalendar. They now have their ICU 68.2 prototypes and do what ucal.cpp and udat.cpp do before the object is needed, inCalendar.cppandDateFormat.cpp, the way #17265 did it for 70 other recovered exports. NoUCalendarorUDateFormatobject can exist yet (ucal_openandudat_openthrow on a valid call), so every path that reads one still throwsNotImplemented_nid_no_patch.ucal_getAttributeUCAL_LENIENTtoUCAL_SKIPPED_WALL_TIME): -1, thedefaultof itsswitch, without reading the calendarucal_getDayOfWeekTypeUCAL_WEEKDAY(0), status untoucheducal_openTimeZoneIDEnumerationTZEnumeration::createreturns null, thenuenum_openFromStringEnumerationreturns null)ucal_openTimeZonesuenum_openFromStringEnumerationdeletes the enumeration and returns null)udat_countSymbolsdynamic_castmatchesudat_getCalendarA null
UErrorCodethrows, as for the other calendar exports: the console dereferences it.Debt: two entries are added next to the existing calendar and date format ones (those two are close to the 1000-character limit, so the new exports get their own entries). The
recovered inventory exportsentry goes from 39 to 33 placeholders left;tools/debt_fold.py --checkrefuses two fragments that change the same entry and asks to merge them, so that count is edited in the pendingfeat-libsceicu-field-position-iterator.mdfragment.Stacked on #23819. That PR edits the same count line (47 to 39) for eight
usearchexports, andpr_overlapreports the two as conflicting there. This branch is therefore one commit on top of #23819's commit72d2b41c59; until #23819 merges, the diff shows both commits, and onlye045338414belongs to this PR. The functions of the two PRs are different.Tested
Windows 11 IoT Enterprise LTSC 2024 (10.0.26100), WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, on72d2b41c59(#23819, itself onmain9d5f50bdf0); the branch merges into currentmainwithout conflict. Not run on a console; the console behaviour of these exports is unverified, as the debt entries say.guest_icu_recovered_signaturespasses.tests/Calendar.cppandtests/DateFormat.cppgain one group per export: astatic_asserton the prototype; the values returned without the object (attributes below 0 and above 4, seven failing status values with a null and a non-null handle, a null format with seven symbol types); a throw where the object is needed (attributes 0 to 4, four non-failing status values, a non-null format,udat_getCalendarwith a null and a non-null format); a null status; the status and the fake object's bytes unchanged.mainthe placeholders areint(), so the new checks cannot compile against them (by construction, not built). Five one-line mutations of the new code each fail the test, then it passes again with the code restored: the attribute bound off by one; a negative attribute reaching the object;ucal_getDayOfWeekTypereturning 1 on a failing status;ucal_openTimeZonesignoring a failing status;udat_countSymbolsreturning -1 for a null format.ctest -R icu: 76 of 76 pass.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.python tools/pr_overlap.py --namesover the six names: each is a stub onmainand no open PR adds or edits it.--branchreports #23819 (above) and could not compare six open PRs that conflict withmainon the recovered inventory files (#18210, #19635, #19645, #19670, #19720, #23196); compared by hand, none of them touches one of the six exports. #19645 rewrites otherucalexports inCalendar.cppover real calendar objects and conflicts withmainalready.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 PrivacyOnion on 2026-11-19T19:05:24Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
e045338414:tools/check_conventions.pypassed.guest_icu_recovered_signatures_testsbuilt cleanly.guest_icu_recovered_signatures):core/libs/prx/libSceIcu/Calendar.cpp,core/libs/prx/libSceIcu/DateFormat.cpp,core/libs/prx/libSceIcu/RecoveredInventory.cpp,core/libs/prx/libSceIcu/RecoveredInventory.hpp,core/libs/prx/libSceIcu/RecoveredSignatures.hpp,core/libs/prx/libSceIcu/StringSearch.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me