make[2]: Entering directory '/gentoo/prefix64/var/tmp/portage/app-portage/portage-utils-0.56/work/portage-utils-0.56' CC q-main.o In file included from libq/libq.c:37:0, from main.c:73: libq/prelink.c: In function ‘is_prelink_elf’: libq/prelink.c:105:32: warning: unused parameter ‘fd’ [-Wunused-parameter] libq/prelink.c:105:48: warning: unused parameter ‘filename’ [-Wunused-parameter] main.c: In function ‘read_repos_conf’: main.c:463:34: error: ‘struct dirent’ has no member named ‘d_type’ main.c:463:46: error: ‘DT_REG’ undeclared (first use in this function) main.c:463:46: note: each undeclared identifier is reported only once for each function it appears in Solaris doesn't have d_type, IIRC we need to use a macro for that to be portable.
masked on Solaris for the time being
@portage-utils, please review patch coming up in a minute
Created attachment 405460 [details, diff] no-DT_REG.patch This changes the code slightly to use a stat to get to the same thing
(In reply to Fabian Groffen from comment #3) err, no, the whole point of using d_type is to avoid stat(). you also don't check the return value of stat which is bad form. utilize DT_UNKNOWN or something like libq/vdb.c.
Solaris doesn't have d_type. Fair enough to avoid the stat, means it needs an ifdef for platforms that don't have/expose d_type.
Same on AIX - probably #ifdef D_REG is more appropriate?
OTOH, embedded gnulib would provide full-fledged dirent module, but apparently only if host completely lacks dirent.h.
since configure already is run, I guess adding a check whether struct dirent has a member named d_type, is cleaner?
probably fixed by: http://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=bb47adc4544369167b931113600d292d2b77c97a