feat(libc): add the C locale helpers _Getctype, _Getcoll, _Getcvt, _Getdateorder, _Strcoll and _Strxfrm #9466

Closed
AlxcBTW wants to merge 4 commits from upstream-pr/9466 into main
AlxcBTW commented 2026-10-21 22:49:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-21T22:49:28Z.


What

Adds six Dinkumware C locale helpers that libc did not export yet, as real APS5_VABI exports in a new file, core/libs/prx/libc/src/CLocaleHelpers.cpp (added to the libc source list; no other locale file is touched):

export NID behaviour
_Getctype gwAf8VMkXS0 returns {_Getpctype(), 0} (table pointer, delete flag) as a 16-byte struct in rax:rdx; the table is the existing classification table, not a copy
_Getcoll 15TBQ3jmXvo returns a zeroed 16-byte struct
_Getcvt HHXmPak83kQ fills a 40-byte block through the hidden return pointer: 1 at +0, 1 at +4, zeros from +8
_Getdateorder LMZCS1i3KTU returns 2
_Strcoll ZyciM6GWVO8 (first1, last1, first2, last2, collvec): compares the two ranges bytewise as unsigned bytes; returns the difference of the first differing bytes, otherwise 0 for equal lengths and -1 or 1 when one range is a prefix of the other
_Strxfrm EvPpDIUyQPI (dest, destEnd, src, srcEnd, collvec): copies the source range when it fits [dest, destEnd) and returns its length; a range that does not fit is not copied at all

C locale only; the collation argument is ignored.

The behaviour was read from the libc.prx bundled with PPSA16064 (disassembly; nothing from it is in the repository), which differs from what the names suggest in four places, so the implementation follows the binary:

  • _Getctype returns its result in registers (rax:rdx), not through a hidden pointer; _Getcvt is the one that uses the hidden pointer.
  • _Getdateorder returns 2, not 0.
  • _Strcoll returns the raw byte difference of the first mismatch ("a" against "c" gives -2), not a normalised -1, and ranges are compared by length as int.
  • _Strxfrm writes nothing when the source is longer than the destination range (it does not copy a truncated prefix); it still returns the source length.

_Getcoll is a bare ret in that binary, so the register pair it returns is whatever the caller left; this returns zeros, which is deterministic and what a caller that ignores the C locale collation vector sees. The _Getcvt block is written exactly as far as the console writes it (40 bytes); whether the struct is larger is not known. Both are listed in the libc technical debt (including that the _Getcvt size is unconfirmed) (docs/dev/debt/libc.md). None of the six was listed there before, so no entry is removed.

Tested

  • Fork CI (Linux, Ubuntu, "Lab tests" workflow): https://github.com/AlxcBTW/AnyPS5/actions/runs/39684522381 on ci/test/libc-c-locale-helpers-r (this branch's head 52a3e3b1a3 plus the CI scaffolding commit), ctest -R '^(guest_c_locale_helpers|guest_locale|guest_rune_locale|guest_character|guest_strings|guest_wide_strings)$': 6 of 6 passed, including the new guest_c_locale_helpers and the existing locale, character and string tests. The Windows job was not run; the test is registered with the same PATH environment modification as its neighbours.
  • New guest test core/libs/tests/GuestCLocaleHelpers.cpp calls the exports directly with hand-computed vectors:
    • _Strcoll: equal ranges give 0, empty against empty 0, "a"/"b" negative, "b"/"a" positive, "a"/"c" exactly -2, prefixes give -1 and 1, 0x80/0x7f and 0xff/0x01 compare as unsigned bytes (1, 254), embedded NUL bytes are compared, a mismatch in the 17th byte after 16 equal ones is found.
    • _Strxfrm: destination larger (copied, bytes after it untouched, returns 5), destination exactly the length (copied), destination smaller or zero-length (nothing written, still returns 5), empty source returns 0, binary bytes 00 80 ff 61 are copied unchanged.
    • _Getctype: struct size and field offsets by static_assert, table pointer equal to _Getpctype(), delete flag 0, table[-1] 0, and for all 0..255 the entry equals the hand-written classification of that byte (digit, upper, lower, space, punct, hex and control bits; 128..255 are 0).
    • _Getcoll zeros, _Getcvt (size and offset by static_assert, page 1, maximum 1, rest zero, no write past 40 bytes), _Getdateorder 2.
  • No game and no console were used for the tests. The expected values come from the disassembly named above.
  • python3 tools/check_conventions.py --base origin/main passes. Based on 0c6a5bd593. tools/pr_overlap.py finds no pull request implementing these functions (a search of open PR titles and bodies for each name also finds none); it lists textual overlaps in core/libs/prx/libc/CMakeLists.txt and docs/dev/debt/libc.md with several open libc PRs (for example #8880, #9038, #8855 edit other locale files and the same two shared files), which are line-level additions in separate places.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA16064 (all six are imported by its app.exe from libc.prx); no Game bring-up discussion yet. Needed before the std::__sce_v2 locale facets.
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4959403481 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9466). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-21T22:49:28Z. --- ### What Adds six Dinkumware C locale helpers that libc did not export yet, as real `APS5_VABI` exports in a new file, `core/libs/prx/libc/src/CLocaleHelpers.cpp` (added to the libc source list; no other locale file is touched): | export | NID | behaviour | |---|---|---| | `_Getctype` | `gwAf8VMkXS0` | returns `{_Getpctype(), 0}` (table pointer, delete flag) as a 16-byte struct in rax:rdx; the table is the existing classification table, not a copy | | `_Getcoll` | `15TBQ3jmXvo` | returns a zeroed 16-byte struct | | `_Getcvt` | `HHXmPak83kQ` | fills a 40-byte block through the hidden return pointer: `1` at +0, `1` at +4, zeros from +8 | | `_Getdateorder` | `LMZCS1i3KTU` | returns 2 | | `_Strcoll` | `ZyciM6GWVO8` | `(first1, last1, first2, last2, collvec)`: compares the two ranges bytewise as unsigned bytes; returns the difference of the first differing bytes, otherwise 0 for equal lengths and -1 or 1 when one range is a prefix of the other | | `_Strxfrm` | `EvPpDIUyQPI` | `(dest, destEnd, src, srcEnd, collvec)`: copies the source range when it fits `[dest, destEnd)` and returns its length; a range that does not fit is not copied at all | C locale only; the collation argument is ignored. The behaviour was read from the `libc.prx` bundled with PPSA16064 (disassembly; nothing from it is in the repository), which differs from what the names suggest in four places, so the implementation follows the binary: - `_Getctype` returns its result in registers (rax:rdx), not through a hidden pointer; `_Getcvt` is the one that uses the hidden pointer. - `_Getdateorder` returns 2, not 0. - `_Strcoll` returns the raw byte difference of the first mismatch (`"a"` against `"c"` gives -2), not a normalised -1, and ranges are compared by length as `int`. - `_Strxfrm` writes nothing when the source is longer than the destination range (it does not copy a truncated prefix); it still returns the source length. `_Getcoll` is a bare `ret` in that binary, so the register pair it returns is whatever the caller left; this returns zeros, which is deterministic and what a caller that ignores the C locale collation vector sees. The `_Getcvt` block is written exactly as far as the console writes it (40 bytes); whether the struct is larger is not known. Both are listed in the libc technical debt (including that the `_Getcvt` size is unconfirmed) (`docs/dev/debt/libc.md`). None of the six was listed there before, so no entry is removed. ### Tested - Fork CI (Linux, Ubuntu, "Lab tests" workflow): https://github.com/AlxcBTW/AnyPS5/actions/runs/39684522381 on `ci/test/libc-c-locale-helpers-r` (this branch's head `52a3e3b1a3` plus the CI scaffolding commit), `ctest -R '^(guest_c_locale_helpers|guest_locale|guest_rune_locale|guest_character|guest_strings|guest_wide_strings)$'`: 6 of 6 passed, including the new `guest_c_locale_helpers` and the existing locale, character and string tests. The Windows job was not run; the test is registered with the same `PATH` environment modification as its neighbours. - New guest test `core/libs/tests/GuestCLocaleHelpers.cpp` calls the exports directly with hand-computed vectors: - `_Strcoll`: equal ranges give 0, empty against empty 0, `"a"`/`"b"` negative, `"b"`/`"a"` positive, `"a"`/`"c"` exactly -2, prefixes give -1 and 1, `0x80`/`0x7f` and `0xff`/`0x01` compare as unsigned bytes (1, 254), embedded NUL bytes are compared, a mismatch in the 17th byte after 16 equal ones is found. - `_Strxfrm`: destination larger (copied, bytes after it untouched, returns 5), destination exactly the length (copied), destination smaller or zero-length (nothing written, still returns 5), empty source returns 0, binary bytes `00 80 ff 61` are copied unchanged. - `_Getctype`: struct size and field offsets by `static_assert`, table pointer equal to `_Getpctype()`, delete flag 0, `table[-1]` 0, and for all 0..255 the entry equals the hand-written classification of that byte (digit, upper, lower, space, punct, hex and control bits; 128..255 are 0). - `_Getcoll` zeros, `_Getcvt` (size and offset by `static_assert`, page 1, maximum 1, rest zero, no write past 40 bytes), `_Getdateorder` 2. - No game and no console were used for the tests. The expected values come from the disassembly named above. - `python3 tools/check_conventions.py --base origin/main` passes. Based on `0c6a5bd593`. `tools/pr_overlap.py` finds no pull request implementing these functions (a search of open PR titles and bodies for each name also finds none); it lists textual overlaps in `core/libs/prx/libc/CMakeLists.txt` and `docs/dev/debt/libc.md` with several open libc PRs (for example #8880, #9038, #8855 edit other locale files and the same two shared files), which are line-level additions in separate places. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA16064 (all six are imported by its `app.exe` from `libc.prx`); no Game bring-up discussion yet. Needed before the `std::__sce_v2` locale facets. - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-21 22:50:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T22:50:03Z.


Progress report (a6dcea9 → 52a3e3b)

📈 System libraries: 42.36% (+0.03%, +6 implemented functions)

✅ 6 implemented
Library Name
libc _Getcoll_nid_postfix
libc _Getctype_nid_postfix
libc _Getcvt_nid_postfix
libc _Getdateorder_nid_postfix
libc _Strcoll_nid_postfix
libc _Strxfrm_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6328288666 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9466#issuecomment-6328288666). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T22:50:03Z. --- <!-- progress-report --> ### Progress report (a6dcea9 → 52a3e3b) 📈 **System libraries**: 42.36% (+0.03%, +6 implemented functions) <details> <summary>✅ 6 implemented</summary> | Library | Name | | - | - | | libc | `_Getcoll_nid_postfix` | | libc | `_Getctype_nid_postfix` | | libc | `_Getcvt_nid_postfix` | | libc | `_Getdateorder_nid_postfix` | | libc | `_Strcoll_nid_postfix` | | libc | `_Strxfrm_nid_postfix` | </details>
MarcZX10 commented 2026-10-21 23:01:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T23:01:32Z.

Review: APPROVED


Reviewed the implementation and tests for the C-locale-only helpers. The fixed-width layouts match the recorded reverse-engineering evidence and are guarded with static assertions; the byte-range comparisons handle embedded NUL and unsigned bytes; transform copies only when the full source fits, as documented in the debt entry. The Ctype table reuses the existing _Getpctype table, and the test covers its negative sentinel and all 256 byte entries. Current conventions, intake, eligibility, relinker matrix, register-context, write-watch, and report checks pass. Full Linux/Windows builds were skipped, and I did not run a local build in this session.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5607279945 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9466#pullrequestreview-5607279945). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T23:01:32Z. **Review:** APPROVED --- Reviewed the implementation and tests for the C-locale-only helpers. The fixed-width layouts match the recorded reverse-engineering evidence and are guarded with static assertions; the byte-range comparisons handle embedded NUL and unsigned bytes; transform copies only when the full source fits, as documented in the debt entry. The Ctype table reuses the existing `_Getpctype` table, and the test covers its negative sentinel and all 256 byte entries. Current conventions, intake, eligibility, relinker matrix, register-context, write-watch, and report checks pass. Full Linux/Windows builds were skipped, and I did not run a local build in this session.
MarcZX10 commented 2026-10-22 04:33:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:33:45Z.

Review: CHANGES_REQUESTED


The implementation review and reported evidence are comprehensive: the fixed-width structs are guarded, byte comparisons include high-bit and embedded-NUL cases, and the full-copy-only _Strxfrm behavior matches the documented binary evidence. The checked head is based on a6dcea927, 47 upstream commits behind current main (110a18ba01). Please update the branch and rerun conventions, overlap/debt checks, and the focused C locale helper suite against the updated tree. The overlap report also has incomplete comparisons for shared CMakeLists.txt and libc debt files; confirm the additions remain additive with current work during that recheck. Existing hosted checks pass as listed; full Linux/Windows jobs were skipped, and I did not run local tests.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609298419 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9466#pullrequestreview-5609298419). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T04:33:45Z. **Review:** CHANGES_REQUESTED --- The implementation review and reported evidence are comprehensive: the fixed-width structs are guarded, byte comparisons include high-bit and embedded-NUL cases, and the full-copy-only `_Strxfrm` behavior matches the documented binary evidence. The checked head is based on `a6dcea927`, 47 upstream commits behind current `main` (`110a18ba01`). Please update the branch and rerun conventions, overlap/debt checks, and the focused C locale helper suite against the updated tree. The overlap report also has incomplete comparisons for shared `CMakeLists.txt` and libc debt files; confirm the additions remain additive with current work during that recheck. Existing hosted checks pass as listed; full Linux/Windows jobs were skipped, and I did not run local tests.
harisibrar1 commented 2026-10-22 13:24:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-22T13:24:54Z.

Review: APPROVED


Checked against main 830ccd121f, the Dinkumware C-locale _Strcoll/_Strxfrm/_Ctypevec/_Collvec definitions, the SysV x86-64 return classification, and the NID calculator:

  • All six NIDs match, and none of the six is on main yet. The head merges onto 830ccd121f with no conflicts in CMakeLists.txt or docs/dev/debt/libc.md, so the rebase request should be easy to satisfy.
  • The struct sizes give the return paths described: the 16-byte Ctypevec/Collvec come back in rax:rdx, and the 40-byte Cvtvec through the hidden pointer. _Strcoll/_Strxfrm match the Dinkumware C-locale behaviour.
  • Nit: in time_base::dateorder (no_order, dmy, mdy, ymd, ydm), 2 is mdy, the usual C-locale order, so DateOrderMdy would be a clearer name than DateOrderNone (CLocaleHelpers.cpp:30).
  • Nit: the trailing-bytes check in CheckCvt (GuestCLocaleHelpers.cpp:159-164) copies sizeof(Cvtvec) from a local into raw, so bytes 40..47 can't change and the check always passes. It could be dropped, or the test could call through a pointer to a function returning a larger struct.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614927815 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9466#pullrequestreview-5614927815). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-22T13:24:54Z. **Review:** APPROVED --- Checked against main 830ccd121f, the Dinkumware C-locale `_Strcoll`/`_Strxfrm`/`_Ctypevec`/`_Collvec` definitions, the SysV x86-64 return classification, and the NID calculator: - All six NIDs match, and none of the six is on main yet. The head merges onto 830ccd121f with no conflicts in `CMakeLists.txt` or `docs/dev/debt/libc.md`, so the rebase request should be easy to satisfy. - The struct sizes give the return paths described: the 16-byte `Ctypevec`/`Collvec` come back in rax:rdx, and the 40-byte `Cvtvec` through the hidden pointer. `_Strcoll`/`_Strxfrm` match the Dinkumware C-locale behaviour. - Nit: in `time_base::dateorder` (`no_order, dmy, mdy, ymd, ydm`), 2 is `mdy`, the usual C-locale order, so `DateOrderMdy` would be a clearer name than `DateOrderNone` (CLocaleHelpers.cpp:30). - Nit: the trailing-bytes check in `CheckCvt` (GuestCLocaleHelpers.cpp:159-164) copies `sizeof(Cvtvec)` from a local into `raw`, so bytes 40..47 can't change and the check always passes. It could be dropped, or the test could call through a pointer to a function returning a larger struct. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
jotitadev commented 2026-10-27 05:32:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T05:32:10Z.

Review: COMMENTED


Merge-skew check: head 52a3e3b1a merged onto current main abed03546 (clean merge, git merge --no-commit). This head's CI ran on the October 21 base. Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, BUILD_TESTING=ON, full build, then the full non-GPU suite (ctest -E "^agc|gpu|vulkan|video_out" -j6). main alone: 1363/1363 pass. With this PR there are two failures, each 3/3. Both come from main changes that landed after the earlier runs in this thread.

1. guest_c_locale_helpers aborts ("C locale helper check failed at line 138"). On current main, _Getpctype()['\t'] is 0x4c0, while the test's Classify expects 0xc0 (line 138, and the literal at line 142). #10387 (d2e18d53b, merged 2026-10-26 01:28 UTC) made the shared classification table mark tab with 0x400, as the console's libc does (isblank). _Getctype returns that same table, so the change is only in the test's expectation:

     if (value >= '\t' && value <= '\r') mask |= 0x40;
+    if (value == '\t') mask |= 0x400;
@@
-    Require(vec.table[' '] == 0x04 && vec.table['\t'] == 0xc0 && vec.table['\n'] == 0xc0);
+    Require(vec.table[' '] == 0x04 && vec.table['\t'] == 0x4c0 && vec.table['\n'] == 0xc0);

2. public_headers fails (its 64 public_headers_compile_* dependents don't run):

_Getctype_nid_postfix / _Getcoll_nid_postfix / _Getcvt_nid_postfix / _Getdateorder_nid_postfix / _Strcoll_nid_postfix / _Strxfrm_nid_postfix:
  expected exactly one header declaration; found 1: core/libs/tests/GuestCLocaleHelpers.cpp:28..33
_Getpctype_nid_postfix: expected exactly one header declaration; found 3: core/libs/prx/libc/include/Api.hpp:496, core/libs/prx/libc/src/CLocaleHelpers.cpp:36, core/libs/tests/GuestCLocaleHelpers.cpp:27

#10706 (merged 2026-10-24) added this audit. Each export needs one declaration, in a header reachable from libc.hpp. The fix I checked:

  • Move the GuestCLocale::Ctypevec/Collvec/Cvtvec structs, with their static_asserts, from CLocaleHelpers.cpp into core/libs/prx/libc/include/Api.hpp.
  • Declare the six exports in Api.hpp right after _Getpctype_nid_postfix.
  • Include Api.hpp in CLocaleHelpers.cpp and drop its local _Getpctype declaration.
  • In the test, include Api.hpp, drop the local structs and extern "C" block, and use using GuestCLocale::Ctypevec; (and the same for Collvec and Cvtvec).

With both changes on top of the merge, the full non-GPU suite passes 1364/1364, including guest_c_locale_helpers, guest_locale, guest_character, public_headers and all public_headers_compile_*. I can post the full diff if that helps.

The head still merges cleanly onto the newer main 92bfca720. Since abed03546, nothing there has touched the audit script, libc/include/Api.hpp or the tab bit.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5662649443 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9466#pullrequestreview-5662649443). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T05:32:10Z. **Review:** COMMENTED --- Merge-skew check: head `52a3e3b1a` merged onto current `main` `abed03546` (clean merge, `git merge --no-commit`). This head's CI ran on the October 21 base. Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release, `BUILD_TESTING=ON`, full build, then the full non-GPU suite (`ctest -E "^agc|gpu|vulkan|video_out" -j6`). `main` alone: 1363/1363 pass. With this PR there are two failures, each 3/3. Both come from `main` changes that landed after the earlier runs in this thread. **1. `guest_c_locale_helpers` aborts** ("C locale helper check failed at line 138"). On current `main`, `_Getpctype()['\t']` is `0x4c0`, while the test's `Classify` expects `0xc0` (line 138, and the literal at line 142). #10387 (d2e18d53b, merged 2026-10-26 01:28 UTC) made the shared classification table mark tab with `0x400`, as the console's libc does (`isblank`). `_Getctype` returns that same table, so the change is only in the test's expectation: ```diff if (value >= '\t' && value <= '\r') mask |= 0x40; + if (value == '\t') mask |= 0x400; @@ - Require(vec.table[' '] == 0x04 && vec.table['\t'] == 0xc0 && vec.table['\n'] == 0xc0); + Require(vec.table[' '] == 0x04 && vec.table['\t'] == 0x4c0 && vec.table['\n'] == 0xc0); ``` **2. `public_headers` fails** (its 64 `public_headers_compile_*` dependents don't run): ``` _Getctype_nid_postfix / _Getcoll_nid_postfix / _Getcvt_nid_postfix / _Getdateorder_nid_postfix / _Strcoll_nid_postfix / _Strxfrm_nid_postfix: expected exactly one header declaration; found 1: core/libs/tests/GuestCLocaleHelpers.cpp:28..33 _Getpctype_nid_postfix: expected exactly one header declaration; found 3: core/libs/prx/libc/include/Api.hpp:496, core/libs/prx/libc/src/CLocaleHelpers.cpp:36, core/libs/tests/GuestCLocaleHelpers.cpp:27 ``` #10706 (merged 2026-10-24) added this audit. Each export needs one declaration, in a header reachable from `libc.hpp`. The fix I checked: - Move the `GuestCLocale::Ctypevec`/`Collvec`/`Cvtvec` structs, with their `static_assert`s, from `CLocaleHelpers.cpp` into `core/libs/prx/libc/include/Api.hpp`. - Declare the six exports in `Api.hpp` right after `_Getpctype_nid_postfix`. - Include `Api.hpp` in `CLocaleHelpers.cpp` and drop its local `_Getpctype` declaration. - In the test, include `Api.hpp`, drop the local structs and `extern "C"` block, and use `using GuestCLocale::Ctypevec;` (and the same for `Collvec` and `Cvtvec`). With both changes on top of the merge, the full non-GPU suite passes 1364/1364, including `guest_c_locale_helpers`, `guest_locale`, `guest_character`, `public_headers` and all `public_headers_compile_*`. I can post the full diff if that helps. The head still merges cleanly onto the newer `main` `92bfca720`. Since `abed03546`, nothing there has touched the audit script, `libc/include/Api.hpp` or the tab bit. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9466
No description provided.