mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1105] runtime/shims: shim GetDateFormatEx and GetTimeFormatEx (OLD-9819) #1142
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1142
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1105
Author: @ambroseautomation
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:carry/old-9819-datetime-shims📝 Commits (2)
9577387runtime/shims: shim GetDateFormatEx and GetTimeFormatEx92bfacdruntime/shims: reject impossible dates and preserve validation errors in datetime shims📊 Changes
4 files changed (+455 additions, -2 deletions)
View changed files
📝
runtime/CMakeLists.txt(+14 -0)➕
runtime/shims/datetime.cpp(+272 -0)➕
runtime/test/datetime_test.cpp(+167 -0)📝
scripts/build_runtime.ps1(+2 -2)📄 Description
Claimed in the coordination issue as: OLD-9819 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140822595)
What and why
Carries forward
old-pr/9819(draft #89, original commit authorpiyonchupreserved; indexed in #17), rebased cleanly onto currentmain(71f99e224) without the stray UTF-8 BOM inscripts/build_runtime.ps1.Shims
GetDateFormatExandGetTimeFormatExacrosskernel32.dll,kernelbase.dll, andapi-ms-win-core-datetime-l1-1-1.dllinruntime/shims/datetime.cpp:LEONIDA_LOCALEwhenlpLocaleNameis null or empty (matchingGetUserDefaultLocaleName).LOCALE_NAME_INVARIANTand a built-in Gregorian format-picture renderer when a minimal host lacks locale tables, avoiding 0 returns that cause C++ exceptions in the retail executable.ERROR_INVALID_PARAMETERfor null/negative buffer sizes or invalidSYSTEMTIMEfields, andERROR_INSUFFICIENT_BUFFERfor undersized buffers).owns_dllfalse forkernel32.dll,kernelbase.dll, andapi-ms-win-core-datetime-l1-1-1.dll.datetime_testinruntime/CMakeLists.txtand addsshims\datetime.cpptoscripts/build_runtime.ps1.Tested
datetime_test.exenatively on Windows 11 with MSVC (/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2):datetime_test: PASS (0 failures), zero compiler warnings.runtime/build/gta6rt.exevia.\scripts\build_runtime.ps1 -jobs 8: succeeded cleanly withshims\datetime.cpplinked.python -I tests/test_build_runtime_fallback.py: 10 tests, OK.python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/datetime.cpp runtime/test/datetime_test.cpp scripts/build_runtime.ps1: exit 0 (no game data).GPUs tested: n/a (CPU/OS runtime shim; built and tested on Windows 11 Pro 64-bit, MSVC VS 18)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — runtime shim)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.