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

Albert Astals Cid aacid at kde.org
Sun Feb 11 12:26:37 UTC 2018


El diumenge, 11 de febrer de 2018, a les 13:18:51 CET, Jeroen Ooms va 
escriure:
> Can you please help fix the patch so that we can build on osx again? I
> don't fully understand the internals, the patch was only a suggestion.

I don't have a access to a osx machine, so that's going to be hard.

Cheers,
  Albert

P.D: Please remember to keep the list on CC.

> 
> On Feb 11, 2018 12:11, "Albert Astals Cid" <aacid at kde.org> wrote:
> > 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