From c0d20fce9efa02cd6930c0b0b138812d7154de14 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 21 Mar 2025 14:42:52 -0700 Subject: [PATCH] Fix build on Windows (cherry picked from commit faf6243d1a8cbc898cb254ec62f53256945820be) --- common/git/git_pull_handler.cpp | 6 +++++- common/git/kicad_git_common.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/git/git_pull_handler.cpp b/common/git/git_pull_handler.cpp index 95507ec991..bedc30b0dd 100644 --- a/common/git/git_pull_handler.cpp +++ b/common/git/git_pull_handler.cpp @@ -208,7 +208,11 @@ std::string GIT_PULL_HANDLER::getFormattedCommitDate( const git_time& aTime ) char dateBuffer[64]; time_t time = static_cast( aTime.time ); struct tm timeInfo; - gmtime_r( &time, &timeInfo ); + #ifdef _WIN32 + localtime_s( &timeInfo, &time ); + #else + gmtime_r( &time, &timeInfo ); + #endif strftime( dateBuffer, sizeof( dateBuffer ), "%Y-%b-%d %H:%M:%S", &timeInfo ); return dateBuffer; } diff --git a/common/git/kicad_git_common.cpp b/common/git/kicad_git_common.cpp index 2e6c0adbfb..9a2ea404fc 100644 --- a/common/git/kicad_git_common.cpp +++ b/common/git/kicad_git_common.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include #include