Skip to content

Commit a63e3cc

Browse files
author
Raphael Moll
committed
Cygwin fix: Use new #if HAVE_STAT_ST_MTIM
stat.st_mtim doesn't exist under MinGW or Cygwin. Change-Id: I0d9c81a0529d8d289d84600ed9d1a451e7f1f258
1 parent 3bab7f0 commit a63e3cc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

libs/host/CopyFile.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,19 @@ static bool isSourceNewer(const struct stat* pSrcStat, const struct stat* pDstSt
6464

6565
/*
6666
* Returns true if the source file has high resolution modification
67-
* date. Cygwin doesn't support st_mtim in normal build, so always
68-
* return false.
67+
* date. Cygwin/Mingw doesn't support st_mtim and always returns false.
6968
*/
7069
static bool isHiresMtime(const struct stat* pSrcStat)
7170
{
72-
#if defined(WIN32_EXE) || defined(USE_MINGW)
73-
return 0;
74-
#elif defined(MACOSX_RSRC)
71+
#if HAVE_STAT_ST_MTIM
72+
#if defined(MACOSX_RSRC)
7573
return pSrcStat->st_mtimespec.tv_nsec > 0;
7674
#else
7775
return pSrcStat->st_mtim.tv_nsec > 0;
7876
#endif
77+
#else
78+
return 0;
79+
#endif
7980
}
8081

8182
/*

0 commit comments

Comments
 (0)