PR libstdc++/88749 fix build failure in src/filesystem/ops.cc
authorJonathan Wakely <jwakely@redhat.com>
Tue, 8 Jan 2019 10:18:54 +0000 (10:18 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 8 Jan 2019 10:18:54 +0000 (10:18 +0000)
PR libstdc++/88749
* src/filesystem/ops.cc (last_write_time): Fix preprocessor condition
to match the one that controls whether utimbuf and utime are declared.

From-SVN: r267705

libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/ops.cc

index 0babce9a9205f29435f872fbf5d15d1bfd316541..f3853f26bac1ade412ec34caf0981bc57a70fe6e 100644 (file)
@@ -1,3 +1,9 @@
+2019-01-08  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR libstdc++/88749
+       * src/filesystem/ops.cc (last_write_time): Fix preprocessor condition
+       to match the one that controls whether utimbuf and utime are declared.
+
 2019-01-07  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/87787
index 369604da80f1ae1c89cb872227ac1785e63da4b0..41850b8fc5757717e926d662b09c4375bc6496d2 100644 (file)
@@ -41,7 +41,7 @@
 # include <fcntl.h>  // AT_FDCWD, AT_SYMLINK_NOFOLLOW
 #endif
 #ifdef _GLIBCXX_HAVE_SYS_STAT_H
-#  include <sys/stat.h>   // stat, utimensat, fchmodat
+# include <sys/stat.h>   // stat, utimensat, fchmodat
 #endif
 #ifdef _GLIBCXX_HAVE_SYS_STATVFS_H
 # include <sys/statvfs.h> // statvfs
@@ -909,7 +909,7 @@ fs::last_write_time(const path& p __attribute__((__unused__)),
     ec.assign(errno, std::generic_category());
   else
     ec.clear();
-#elif _GLIBCXX_HAVE_UTIME_H
+#elif _GLIBCXX_USE_UTIME && _GLIBCXX_HAVE_SYS_STAT_H
   posix::utimbuf times;
   times.modtime = s.count();
   times.actime = do_stat(p, ec, [](const auto& st) { return st.st_atime; },