PR28156, rename.c doesn't compile with MinGW

Message ID YQokja/
State New
Headers show
  • PR28156, rename.c doesn't compile with MinGW
Related show

Commit Message

Cooper Qu via Binutils Aug. 4, 2021, 5:24 a.m.
Guard against lack of struct timespec definition.

	PR 28156
	* rename.c (get_stat_atime, get_stat_mtime): Don't compile
	unless HAVE_UTIMENSAT is defined.

Alan Modra
Australia Development Lab, IBM


diff --git a/binutils/rename.c b/binutils/rename.c
index 8826917c18c..48ae3014806 100644
--- a/binutils/rename.c
+++ b/binutils/rename.c
@@ -131,6 +131,7 @@  get_stat_mtime_ns (struct stat const *st ATTRIBUTE_UNUSED)
 # endif
+#if defined HAVE_UTIMENSAT
 /* Return *ST's access time.  */
 static inline struct timespec
 get_stat_atime (struct stat const *st)
@@ -158,6 +159,7 @@  get_stat_mtime (struct stat const *st)
   return t;
 /* End FIXME.  */
 /* Set the times of the file DESTINATION to be the same as those in