]> git.ipfire.org Git - thirdparty/git.git/commit
mingw: use strftime() directly in UCRT builds
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 3 Apr 2026 09:56:23 +0000 (09:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Apr 2026 17:36:48 +0000 (10:36 -0700)
commitc664ee2001a1ea0ecbc6448b24303687e6caf1cb
tree190031bbd9321d254749a873ad1c88d0d79f1fc0
parent256554692df0685b45e60778b08802b720880c50
mingw: use strftime() directly in UCRT builds

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c