feat(libc): implement Dinkumware wide conversion exports #3083

Merged
MarcZX10 merged 2 commits from upstream-pr/3083 into main 2026-10-10 22:01:31 +00:00
MarcZX10 commented 2026-10-10 21:51:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T21:51:14Z.


What

Carry screamm's explicitly offered wide-conversion implementation from issue #3077. It adds _WStoul, _Iswctype and swscanf_s, with focused tests for wide classification, conversion errors and secure wide scanning. The original source commits and author attribution are preserved. This branch includes the prerequisite fix from PR #3082; it depends on that PR.

Tested

The contributor reports Windows 11 Pro 26220 / WinLibs MinGW-w64 GCC 15.2.0 / Release full build including libs; guest_wide_conversion, guest_math, guest_wide_strings, guest_rune_locale, guest_scan_count and guest_wide_formatting passed 3/3, and ctest -j8 -E "^agc_|video_out" passed 389/389. Linux runtime tests were not reported. In this session, conventions and git diff --check passed; the local full CMake configure was blocked by the unavailable pinned SDL2 submodule commit.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #3082
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4814684750 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3083). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-10T21:51:14Z. --- ### What Carry screamm's explicitly offered wide-conversion implementation from issue #3077. It adds `_WStoul`, `_Iswctype` and `swscanf_s`, with focused tests for wide classification, conversion errors and secure wide scanning. The original source commits and author attribution are preserved. This branch includes the prerequisite fix from PR #3082; it depends on that PR. ### Tested The contributor reports Windows 11 Pro 26220 / WinLibs MinGW-w64 GCC 15.2.0 / Release full build including `libs`; `guest_wide_conversion`, `guest_math`, `guest_wide_strings`, `guest_rune_locale`, `guest_scan_count` and `guest_wide_formatting` passed 3/3, and `ctest -j8 -E "^agc_|video_out"` passed 389/389. Linux runtime tests were not reported. In this session, conventions and `git diff --check` passed; the local full CMake configure was blocked by the unavailable pinned SDL2 submodule commit. ### Checklist - [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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #3082 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-10 21:51:50 +00:00 (Migrated from github.com)

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


Progress report (262c031 → 51fca3c)

📈 System libraries: 84.53% (+0.09%, +3 implemented functions)

✅ 3 implemented
Library Name
libc _Iswctype_nid_postfix
libc _WStoul_nid_postfix
libc swscanf_s_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102557809 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3083#issuecomment-6102557809). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T21:51:50Z. --- <!-- progress-report --> ### Progress report (262c031 → 51fca3c) 📈 **System libraries**: 84.53% (+0.09%, +3 implemented functions) <details> <summary>✅ 3 implemented</summary> | Library | Name | | - | - | | libc | `_Iswctype_nid_postfix` | | libc | `_WStoul_nid_postfix` | | libc | `swscanf_s_nid_postfix` | </details>
github-actions[bot] commented 2026-10-10 21:54:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T21:54:11Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2651 swscanf_s_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102577456 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3083#issuecomment-6102577456). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T21:54:11Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2651 | | `swscanf_s_nid_postfix` | |
adriadam10 commented 2026-10-10 22:01:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:01:28Z.


Checked the three exports against the C11 rules and the Dinkumware xwcc.h class numbering; guest_math and guest_wide_conversion pass on Linux, and the new test target does not build without the change. The TechnicalDebt entry lists the unverified choices (class numbering on the console's libc.prx, unsigned int size argument). Merging.

This branch includes the strtol fix from #3082, so that PR is covered by this one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102637984 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3083#issuecomment-6102637984). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T22:01:28Z. --- Checked the three exports against the C11 rules and the Dinkumware `xwcc.h` class numbering; `guest_math` and `guest_wide_conversion` pass on Linux, and the new test target does not build without the change. The TechnicalDebt entry lists the unverified choices (class numbering on the console's `libc.prx`, `unsigned int` size argument). Merging. This branch includes the `strtol` fix from #3082, so that PR is covered by this one.
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!3083
No description provided.