Skip to content

Commit e85e2b1

Browse files
committed
convbin: workaround gmtime_r for windows WIN32
MSC has gmtime_s, but not BCC which has gmtime_r.
1 parent 1a4f998 commit e85e2b1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

app/consapp/convbin/convbin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,11 @@ static int get_filetime(const char *file, gtime_t *time)
403403
struct stat st;
404404
if (!stat(path, &st)) {
405405
struct tm tm;
406+
#ifdef _MSC_VER
407+
if (gmtime_s(&tm, &st.st_mtime)) {
408+
#else
406409
if (gmtime_r(&st.st_mtime, &tm)) {
410+
#endif
407411
double ep[6];
408412
ep[0] = tm.tm_year + 1900;
409413
ep[1] = tm.tm_mon + 1;

0 commit comments

Comments
 (0)