Correction, the patch I forgot to attach... :-\

Am 21.03.2018 um 14:52 schrieb Adam Reichold:
> have you given the patch I attached earlier a try? 
diff --git a/goo/gfile.cc b/goo/gfile.cc
index 06014b3e..e29cbfaf 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -81,7 +81,19 @@ using void_t = typename void_type< Args... >::type;
 template< typename Stat, typename = void_t<> >
 struct StatMtim
 {
-  static const struct timespec& value(const Stat& stbuf) {
+  using type = struct timespec;
+  static type value(const Stat& stbuf) {
+    // If the implementation does not support a high-resolution mtime, we synthesize a low-resolution one.
+    struct timespec mtim{ stbuf.st_mtime, 0 };
+    return mtim;
+  }
+};
+
+template< typename Stat >
+struct StatMtim< Stat, void_t< decltype ( Stat::st_mtim ) > >
+{
+  using type = const struct timespec&;
+  static type value(const Stat& stbuf) {
     return stbuf.st_mtim;
   }
 };
@@ -90,12 +102,13 @@ struct StatMtim
 template< typename Stat >
 struct StatMtim< Stat, void_t< decltype ( Stat::st_mtimespec ) > >
 {
-  static const struct timespec& value(const Stat& stbuf) {
+  using type = const struct timespec&;
+  static type value(const Stat& stbuf) {
     return stbuf.st_mtimespec;
   }
 };
 
-inline const struct timespec& mtim(const struct stat& stbuf) {
+inline auto mtim(const struct stat& stbuf) -> StatMtim< struct stat >::type {
   return StatMtim< struct stat >::value(stbuf);
 }
 
_______________________________________________
poppler mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to