Skip to content

mingw: use strftime() directly in UCRT builds#2079

Closed
dscho wants to merge 1 commit intogitgitgadget:masterfrom
dscho:mingw-use-strftime-directly-in-UCRT-builds
Closed

mingw: use strftime() directly in UCRT builds#2079
dscho wants to merge 1 commit intogitgitgadget:masterfrom
dscho:mingw-use-strftime-directly-in-UCRT-builds

Conversation

@dscho
Copy link
Copy Markdown
Member

@dscho dscho commented Apr 3, 2026

Since the MSYS2 project deprecated the MINGW64 environment on which Git for Windows relies, we have to prepare quite swiftly for a future where we switch to the UCRT64 environment instead. This patch is the only fall-out of that that concerns the Git source code.

The `mingw_strftime()` wrapper exists to work around msvcrt.dll's
incomplete `strftime()` implementation by dynamically loading the
version from ucrtbase.dll at runtime via `LoadLibrary()` +
`GetProcAddress()`. When the binary is already linked against UCRT
(i.e. when building in the UCRT64 environment), the linked-in
`strftime()` is the ucrtbase.dll version, making the dynamic loading
needless churn: It's calling the very same code.

Simply guard both the declaration and implementation so that the
unnecessary work-around is skipped in UCRT builds.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho self-assigned this Apr 3, 2026
@dscho
Copy link
Copy Markdown
Member Author

dscho commented Apr 3, 2026

/submit

@gitgitgadget
Copy link
Copy Markdown

gitgitgadget bot commented Apr 3, 2026

Submitted as pull.2079.git.1775210183103.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-2079/dscho/mingw-use-strftime-directly-in-UCRT-builds-v1

To fetch this version to local tag pr-2079/dscho/mingw-use-strftime-directly-in-UCRT-builds-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-2079/dscho/mingw-use-strftime-directly-in-UCRT-builds-v1

@gitgitgadget
Copy link
Copy Markdown

gitgitgadget bot commented Apr 3, 2026

This patch series was integrated into seen via git@d914313.

@gitgitgadget
Copy link
Copy Markdown

gitgitgadget bot commented Apr 3, 2026

This patch series was integrated into next via git@3ed53e1.

@gitgitgadget
Copy link
Copy Markdown

gitgitgadget bot commented Apr 4, 2026

This branch is now known as js/mingw-use-strftime-directly-in-ucrt-build.

@gitgitgadget
Copy link
Copy Markdown

gitgitgadget bot commented Apr 4, 2026

This patch series was integrated into seen via git@e1bfba5.

@gitgitgadget
Copy link
Copy Markdown

gitgitgadget bot commented Apr 4, 2026

This patch series was integrated into master via git@e1bfba5.

@gitgitgadget
Copy link
Copy Markdown

gitgitgadget bot commented Apr 4, 2026

This patch series was integrated into next via git@e1bfba5.

@gitgitgadget gitgitgadget bot added the master label Apr 4, 2026
@gitgitgadget
Copy link
Copy Markdown

gitgitgadget bot commented Apr 4, 2026

Congratulations! 🎉 Your patch series was merged into upstream via e1bfba5.

Note: this pull request will show as "Closed" rather than "Merged" because the merge happened in the upstream repository, not on GitHub. This is expected — your contribution has been accepted!

@gitgitgadget gitgitgadget bot closed this Apr 4, 2026
@dscho dscho deleted the mingw-use-strftime-directly-in-UCRT-builds branch April 4, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant