Commit Graph
42 Commits
Author SHA1 Message Date
Dean 940c298d51 Merge pull request #9698 from mazen320/feat/libc-num-put-vtable-size
fix(libc): size the num_put facet vtable to 112 bytes
2026-10-27 18:20:54 +13:00
Dean d6ac53ba34 Merge pull request #11054 from verusferro/feat/libc-num-put-do-put
feat(libc): format num_put<char>::do_put as the console's libc does
2026-10-27 11:00:12 +13:00
Dean e95e81d96a Merge pull request #11233 from edubox/feat/libc-setprecision
feat(libc): export std::setprecision(int)
2026-10-27 10:40:17 +13:00
Dean ed8fd06177 Merge pull request #11166 from 00xDisaster/feat/libc-collate-vtable-wire
feat(libc): wire the collate<char> facet vtable
2026-10-27 10:38:27 +13:00
Maz 13f46081e5 fix(libc): share num_put vtable slot count with GuestLocale 2026-10-26 16:42:43 +04:00
Maz 3e4b36ac6a fix(libc): restore separate GuestLocale vtable helpers 2026-10-26 16:42:43 +04:00
Maz e8aef0f1d8 fix(libc): size the num_put facet vtable to 112 bytes
Titles that import the vtable as data expect fourteen slots (st_size 112 on
PPSA16833 libc.prx); twelve left the object short.
2026-10-26 16:42:42 +04:00
Adrià FranchandClaude Sonnet 5.5 27dd861fa3 test(libc): close CheckFacetGetcat before the wide num_get vtable check
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 11:37:08 +01:00
Maz 1f27ca0c49 feat(libc): export the wide num_get facet vtable as data
Console libSceLibcInternal exports Y9C9GeKyZ3A as a 136-byte STT_OBJECT;
titles that resolve the wide num_get vtable as data need a zeroed 17-slot
object matching the narrow num_get layout on console.
2026-10-26 11:37:08 +01:00
Adrià c8a3b25882 Merge pull request #9464 from mazen320/feat/libc-time-get-w-vtable
feat(libc): export the wide time_get facet vtable as data
2026-10-26 11:19:39 +01:00
Dean 36df54b472 Merge pull request #10387 from JJenkx/windows/libc-ctype-console-masks
fix(libc): return the console's class bits from the ctype functions
2026-10-26 14:28:15 +13:00
Eduardo Ruiz 93b0c59870 feat(libc): export std::setprecision(int)
Dinkumware's setprecision returns the same two-register manipulator as setw: the function pointer in RAX and the precision value in RDX. The function stores the argument at ios_base offset 0x1c, leaving flags and width alone.

Disassembled from the libc.prx bundled in PPSA02530's sce_module, where _ZSt12setprecisioni (NID 1h8hFQghR7w) returns a pointer to 'mov %esi,0x1c(%rdi); ret' and has the same 10-byte export shape as _ZSt4setwi. Negative and zero values are stored unchanged; a null stream throws.
2026-10-25 23:19:11 +01:00
Disaster c66f61ff52 feat(libc): wire the collate<char> facet vtable
The nine-slot _ZTVSt7collateIcE export added by #9979 was still zeroed, so a guest that called through the exported vtable faulted. Fill slots 2 through 8 with the same facet methods that g_collateVtable uses, leave the offset-to-top and typeinfo slots zero, and cover compare, transform, hash, retain and release through the exported object.
2026-10-25 23:21:45 +03:00
Maz 0071bf26f6 fix(libc): restore separate GuestLocale time_get helpers 2026-10-26 00:02:16 +04:00
Maz a48a417101 fix(libc): keep char and wide time_get vtables after rebase 2026-10-26 00:02:16 +04:00
Maz bd6406392f feat(libc): export the wide time_get facet vtable as data 2026-10-26 00:02:15 +04:00
verusferro 1d31901c4b feat(libc): format num_put<char>::do_put as the console's libc does
The num_put facet's eight do_put overloads build the console's printf format from the stream flags, format through snprintf and lay out the result as the SDK libc.prx does: thousands separators from the stream locale's numpunct, its decimal point, fill and width with left, right and internal adjustment, true and false names under boolalpha, and the console's prefix and infinity rules for floating point.
2026-10-25 19:19:16 +03:00
verusferro 3338ffefff feat(libc): format time_put<char>::do_put as the console's libc does
The time_put facet's do_put formats % with the modifier and conversion through strftime and writes the result through the output iterator's stream buffer, following the SDK libc.prx: it stores into the put area while room remains, calls overflow otherwise, and marks the iterator failed when overflow returns eof or the buffer is null.
2026-10-25 19:18:04 +03:00
Adrià Franch 159a6f4407 test(libc): close CheckFacetGetcat before the time_get vtable check 2026-10-25 15:20:11 +01:00
Maz 4e657b158e feat(libc): export the time_get facet vtable as data
Console libSceLibcInternal exports o4kt51-uO48 as a 104-byte STT_OBJECT;
titles that resolve the symbol as data need a zeroed 13-slot vtable like the
other facet vtables, not a missing import.
2026-10-25 15:20:04 +01:00
boykopovar 53a65ec210 fix(sdk): sync declarations with latest main 2026-10-24 23:17:48 +03:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Maz 2f94984276 feat(libc): export the collate facet vtable as data
Titles that resolve collate<char>'s vtable as an object need a 72-byte export matching console libc.prx (PPSA16833).
2026-10-24 21:49:15 +04:00
akkadbakkad89andDevin 6687cf12b7 fix(libc): restore the all-char time_put::id export spelling
The export was mistyped as time_put<char, ostreambuf_iterator<wchar_t,
char_traits<char>>>::id, which demangles to a mixed-instantiation name
absent from aerolib. Restore the all-char spelling so the export keeps
its NID BamOsNbUcn4, and pin it: the test now declares the id extern
and round-trips its storage, so a spelling regression fails to link.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-24 21:01:42 +05:30
akkadbakkad89 31893b2e6d test(libc): register a host heap so facet _Getcat can allocate 2026-10-24 19:15:06 +05:30
akkadbakkad89andDevin 10821403c8 test(libc): exercise CheckFacetGetcat and stop pinning the unimplemented put-facet throws
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-24 19:15:02 +05:30
akkadbakkad89andDevin 88f209ff93 feat(libc): cover the codecvt, numpunct, num_put and time_put facets, their ids and std::clog
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-24 19:14:58 +05:30
JJenkxandClaude Opus 5.5 0f2f387159 Merge main into PR #10387
LocaleSupport.cpp: keep this branch's console class masks for the ctype
classifiers and main's new isascii and toascii.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 05:31:19 -04:00
Maz 859ce80e42 feat(libc): export the wide num_put facet vtable as data
Titles resolve NID 59oywaaZbJk as a 112-byte STT_OBJECT on PPSA16833 libc.prx; export fourteen zeroed slots and the matching id so the data object exists while facet methods stay unwired.
2026-10-24 11:37:58 +04:00
JJenkxandClaude Opus 5.5 d2e18d53b3 fix(libc): return the console's class bits from the ctype functions
isalpha, isdigit, isspace and the other ctype classifiers returned 1 for
a match. The libc.prx bundled with eleven titles returns the matching
bits of its classification table instead, for example 0x20 from isdigit,
0x04 from isspace(' ') and 0x40 from isspace('\t'), and its table marks
tab with 0x400, which isblank returns. The classifiers now return the
exported table's bits under the console's masks, and the table gains the
tab bit; which characters match is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 16:18:56 -04:00
Maz 6224ab70b9 feat(libc): export the wide codecvt facet vtable as data
Console title libc.prx (PPSA26344) and libSceLibcInternal export H-TDszhsYuY as STT_OBJECT st_size 104; titles that resolve it as data need thirteen zeroed uintptr_t slots.
2026-10-23 16:26:44 +04:00
bluandClaude Opus 5.5 428e9cb5f3 fix(libc): size the num_get<char> vtable to the console's 17 slots
mazen320 read KfcTPbeaOqg from the console's libSceLibcInternal.sprx
symbol table: an object of 136 bytes, 17 pointer slots. Export that
size instead of the 15 derived from Dinkumware's crt.vc12 xlocnum, and
say in the debt entry that which two virtual functions are added is
not known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 13:45:04 -07:00
bluandClaude Fable 5.1 46c36c304f feat(libc): export the num_get and time_get locale objects as data
The public SDK's libSceLibcInternal table declares num_get<char>::id, time_get<char>::id and the
num_get<char> vtable as objects; libSceAmpr exported their NIDs as functions that throw, which a
data consumer reads as code (#8875). libc now defines them the way the other facet ids and the
num_put and codecvt vtables are kept: the ids zero, the vtable 15 zeroed slots (two header
entries, the two destructor entries and Dinkumware's eleven do_get), and libSceAmpr drops the
functions. An import qualified to libSceAmpr.prx falls back to libc, so each object has one
identity.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-20 21:13:08 -07:00
T3cm0 6fdb88fd48 fix(libc): share slot 8 in ios_base::_Addstd as the console does 2026-10-19 14:41:10 +02:00
tecmo 4bf4fc9864 feat(libc): implement ios_base::_Addstd
Queue the stream in the table of the 8 standard stream
slots of Dinkumware's ios.cpp: the first free slot or the one
that already holds the stream, with a reference count per slot,
and the destructor suppresses the destruction of a standard
stream while its slot still has open references.
2026-10-19 14:41:10 +02:00
Adrià 6b8228b2bf Merge pull request #6585 from Mouad-Scriptz-0/feat/libc-setw
feat(libc): export std::setw(int)
2026-10-19 09:02:04 +02:00
Mouad-Scriptz-0andClaude Sonnet 5.5 2e86b69fb7 feat(libc): export std::setw(int)
Dinkumware's setw returns a manipulator holding a function pointer and the
width, which the caller applies to the stream; the function stores the
width in the stream's ios_base. The export returns that pair in RAX:RDX and
the function writes ios_base::width, leaving flags and precision alone.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-15 21:20:48 +00:00
notaxeltvandCursor 511db2e8ff feat(libc): export locale::classic for the C locale
Absent PPSA34015 import; return a stable facade over the classic _Locimp.

Co-authored-by: Cursor <[email protected]>
2026-10-15 18:57:39 +02:00
Yunus Shaikh 433bf1ebc2 fix(libc): map _Towctrans descriptors 1 and 2 to lower and upper case
_Towctrans passed the guest's descriptor to the host towctrans.
Dinkumware's <wctype.h> (xwcc.h) defines towlower(wc) as
_Towctrans(wc, 1) and towupper(wc) as _Towctrans(wc, 2), the values
FreeBSD's wctrans.c also uses for "tolower" and "toupper". UCRT reads
1 as toupper and other nonzero values as tolower, so on Windows
towlower(L'A') returned L'A' and towupper(L'a') returned L'a', while
towlower(L'a') returned L'A'. The host wint_t is 16 bits there, which
also turned WEOF into 0xffff. glibc's wctrans_t is a pointer to a
table that towctrans reads, so on Linux descriptor 1 or 2 is
dereferenced as an address.

_Towctrans now takes the guest's 32-bit wint_t and size_t descriptor.
1 and 2 map 0..255 through the C locale tables behind _Getptolower and
_Getptoupper and return other values unchanged. Any other descriptor
sets errno to EINVAL and returns wc unchanged, as FreeBSD's
towctrans_l does.
2026-10-11 16:05:26 -07:00
Nahuel Genchi 2b83a533b8 test(libc): match the immortal classic locale and run guest_locale in ctest 2026-10-07 00:00:12 -03:00
boykopovar 9a4c8eab8b fix(libc): update locale signatures + add sysv abi to math funcs 2026-09-24 22:57:49 +03:00
boykopovar c9a82af00c fix(libc): add guest-compatible c++ locale abi 2026-09-24 10:51:11 +03:00