diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2021-11-25 19:17:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-11-30 16:03:33 (GMT) |
commit | 992e6d7c5dd3a8cdf330bea9cc988d8974f5e3d5 (patch) | |
tree | 8f7eb82f0a98e3e50b4405e873a25931daa7d85b /Source/cmTimestamp.cxx | |
parent | 5109a22d61ebe42c2e36a2fbd35114b22334fa76 (diff) | |
download | CMake-992e6d7c5dd3a8cdf330bea9cc988d8974f5e3d5.zip CMake-992e6d7c5dd3a8cdf330bea9cc988d8974f5e3d5.tar.gz CMake-992e6d7c5dd3a8cdf330bea9cc988d8974f5e3d5.tar.bz2 |
mingw: fix calling convention for strftime()
`strftime` uses `__cdecl` and not `__stdcall`. This was exposed by
refactoring in commit 26c9fbab46 (MINGW-w64: Fix string(TIMESTAMP) build
on 32bits, 2021-11-16, v3.22.0~1^2).
This fixes a crash creating a timestamp with clang+mingw-w64 targeting x86.
Fixes: #22939
Diffstat (limited to 'Source/cmTimestamp.cxx')
-rw-r--r-- | Source/cmTimestamp.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index c8f5a4b..3826577 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -197,7 +197,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag, #ifdef __MINGW32__ /* See a bug in MinGW: https://sourceforge.net/p/mingw-w64/bugs/793/. A work * around is to try to use strftime() from ucrtbase.dll. */ - using T = size_t(WINAPI*)(char*, size_t, const char*, const struct tm*); + using T = size_t(__cdecl*)(char*, size_t, const char*, const struct tm*); auto loadUcrtStrftime = []() -> T { auto handle = LoadLibraryExA("ucrtbase.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); |