From 79727e539c4ed729963a7cfd0cb77b7d0075491c Mon Sep 17 00:00:00 2001 From: oaq Date: Fri, 5 Jun 2026 21:18:10 +1000 Subject: [PATCH] convbin: workaround gmtime_r for windows WIN32 MSC has gmtime_s, but not BCC which has gmtime_r. --- app/consapp/convbin/convbin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/consapp/convbin/convbin.c b/app/consapp/convbin/convbin.c index 44aa24234..765abad00 100644 --- a/app/consapp/convbin/convbin.c +++ b/app/consapp/convbin/convbin.c @@ -403,7 +403,11 @@ static int get_filetime(const char *file, gtime_t *time) struct stat st; if (!stat(path, &st)) { struct tm tm; +#ifdef _MSC_VER + if (gmtime_s(&tm, &st.st_mtime) != 0) { +#else if (gmtime_r(&st.st_mtime, &tm)) { +#endif double ep[6]; ep[0] = tm.tm_year + 1900; ep[1] = tm.tm_mon + 1;