Opened 17 years ago

Closed 17 years ago

Last modified 12 months ago

#568 closed defect (fixed)

ALL: does not compile on solaris

Reported by: SF/stargo Owned by: fingolfin
Priority: normal Component: Port: Solaris
Keywords: Cc:
Game:

Description

When trying to compile a current cvs-checkout
(14.11.02) on a sparc solaris machine, the file
posix-fs can not be compiled, because the solaris
dirent-structure does not have a member called d_type:

c++ -Wp,-MMD,"backends/fs/posix/.deps/posix-fs.d2" -g
-O -Wall -Wstrict-prototypes -Wuninitialized
-Wno-long-long -Wno-multichar -Wno-unknown-pragmas
-DUNIX -DUSE_MAD -DSIMONDEBUG -I. -Icommon `sdl-config
--cflags` -c backends/fs/posix/posix-fs.cpp -o
backends/fs/posix/posix-fs.o
backends/fs/posix/posix-fs.cpp: In method `class FSList
* POSIXFilesystemNode::listDir() const':
backends/fs/posix/posix-fs.cpp:102: `struct dirent' has
no member named `d_type'
backends/fs/posix/posix-fs.cpp:102: `DT_DIR' undeclared
(first use this function)
backends/fs/posix/posix-fs.cpp:102: (Each undeclared
identifier is reported only once
backends/fs/posix/posix-fs.cpp:102: for each function
it appears in.)
gmake: *** [backends/fs/posix/posix-fs.o] Error 1

When replacing the line with a stat-call and then
checking for a directory, scummvm compiles:
#include <sys/stat.h>
...
struct stat dstat;
...
stat(dp->d_name,&dstat);
entry._isDirectory =
S_ISDIR(dstat.st_mode);

But I do not believe this is a clean (or even working
as intended) solution.

Ticket imported from: #638641. Ticket imported from: bugs/568.

Change History (8)

comment:1 by eriktorbjorn, 17 years ago

From what I understand, d_type is a BSD extension to struct
dirent, so using stat() may be the only portable way to
check if a filename points to a directory or not.

comment:2 by fingolfin, 17 years ago

Owner: set to fingolfin

comment:3 by fingolfin, 17 years ago

Should be fixed in current CVS, can you verify that please?

comment:4 by fingolfin, 17 years ago

Resolution: fixed
Status: newpending

comment:5 by SF/stargo, 17 years ago

Status: pendingclosed

comment:6 by SF/stargo, 17 years ago

Yes it is indeed fixed.

comment:7 by digitall, 12 months ago

Component: --Unset--Ports

comment:8 by digitall, 12 months ago

Component: PortsPort: Solaris
Note: See TracTickets for help on using tickets.