-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mingw: use modern strftime implementation if possible #2574
Conversation
Looking back at the diff, it might make sense to move |
In addition to moving it inside, can we also initialize it directly, i.e. |
Microsoft says it should be
yeah, I guess that works. I'll prepare an updated version. |
Sorry, on my phone, couldn't cut 'n paste. |
Microsoft introduced a new "Universal C Runtime Library" (UCRT) with Visual Studio 2015. The UCRT comes with a new strftime() implementation that supports more date formats. We link git against the older "Microsoft Visual C Runtime Library" (MSVCRT), so to use the UCRT strftime() we need to load it from ucrtbase.dll using DECLARE_PROC_ADDR()/INIT_PROC_ADDR(). Most supported Windows systems should have recieved the UCRT via Windows update, but in some cases only MSVCRT might be available. In that case we fall back to using that implementation. This fixes git-for-windows#2495 Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Perfect, @rimrul you're awesome! |
Git [now accepts more date formats](git-for-windows/git#2574) such as `%g` and `%V`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
@dscho @rimrul This might not seem like a big deal for programs that use |
That's exactly what we do. INIT_PROC_ADDR caches the address. See it's implementation here: https://github.com/git/git/blob/53f9a3e157dbbc901a02ac2c73346d375e24978c/compat/win32/lazyload.h#L31-L55 |
Oh, ok, thank you for the clarification and sorry for the misunderstanding. :) |
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
mingw: use modern strftime implementation if possible
Microsoft introduced a new "Universal C Runtime Library" (UCRT) with
Visual Studio 2015. The UCRT comes with a new strftime() implementation that
supports more date formats. We link git against the older "Microsoft Visual C
Runtime Library" (MSVCRT), so to use the UCRT strftime() we need to load it from
ucrtbase.dll using DECLARE_PROC_ADDR()/INIT_PROC_ADDR().
Most supported Windows systems should have recieved the UCRT via Windows update,
but in some cases only MSVCRT might be available. In that case we fall back to
using that implementation.