Skip to content

Commit e1bfba5

Browse files
committed
Merge branch 'js/mingw-use-strftime-directly-in-ucrt-build'
MinGW build updates. * js/mingw-use-strftime-directly-in-ucrt-build: mingw: use strftime() directly in UCRT builds
2 parents 8de2f1b + c664ee2 commit e1bfba5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compat/mingw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,9 @@ int mingw_utime (const char *file_name, const struct utimbuf *times)
13941394
size_t mingw_strftime(char *s, size_t max,
13951395
const char *format, const struct tm *tm)
13961396
{
1397+
#ifdef _UCRT
1398+
size_t ret = strftime(s, max, format, tm);
1399+
#else
13971400
/* a pointer to the original strftime in case we can't find the UCRT version */
13981401
static size_t (*fallback)(char *, size_t, const char *, const struct tm *) = strftime;
13991402
size_t ret;
@@ -1404,6 +1407,7 @@ size_t mingw_strftime(char *s, size_t max,
14041407
ret = strftime(s, max, format, tm);
14051408
else
14061409
ret = fallback(s, max, format, tm);
1410+
#endif
14071411

14081412
if (!ret && errno == EINVAL)
14091413
die("invalid strftime format: '%s'", format);

0 commit comments

Comments
 (0)