[poppler] gfile.cc fails to build on macos due to statbuf.st_mtim

Albert Astals Cid aacid at kde.org
Sun Feb 11 11:11:54 UTC 2018


El divendres, 9 de febrer de 2018, a les 21:08:39 CET, Jeroen Ooms va 
escriure:
> After recent changes (after 0.62) the master branch no longer builds
> on macos. The issue is that the statbuf struct does not have an
> "st_mtim" field on macos:
> 
> [  0%] Building CXX object CMakeFiles/poppler.dir/goo/gfile.cc.o
> /Users/jeroen/Desktop/popplergit/goo/gfile.cc:690:34: error: no member
> named 'st_mtim' in 'stat'
>     modifiedTimeOnOpen = statbuf.st_mtim;
>                          ~~~~~~~ ^
> /Users/jeroen/Desktop/popplergit/goo/gfile.cc:698:49: error: no member
> named 'st_mtim' in 'stat'
>     return modifiedTimeOnOpen.tv_sec != statbuf.st_mtim.tv_sec ||
> modifiedTimeOnOpen.tv_nsec != statbuf.st_mtim.tv_nsec;
>                                         ~~~~~~~ ^
> /Users/jeroen/Desktop/popplergit/goo/gfile.cc:698:105: error: no
> member named 'st_mtim' in 'stat'
>     return modifiedTimeOnOpen.tv_sec != statbuf.st_mtim.tv_sec ||
> modifiedTimeOnOpen.tv_nsec != statbuf.st_mtim.tv_nsec;
> 
>                          ~~~~~~~ ^
> 3 errors generated.
> 
> 
> We need to use the st_mtime field instead. Note that on Linux, stat.h
> defines st_mtime as st_mtim.tv_sec:
> 
>   /usr/include/bits/stat.h:# define st_mtime st_mtim.tv_sec
> 
> So I think the fix is something like this:
> https://github.com/jeroen/poppler-mirror/commit/8e4dc30f73d963432f629e73c0e1
> f4723b47f936 

You're never assigning to tv_nsec in there but still use it in a comparison, 
that needs fixing.

Cheers,
  Albert

> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/poppler






More information about the poppler mailing list