|
From: | Jan Djärv |
Subject: | Re: recent commit broke src/dired.c on OSX |
Date: | Sun, 25 Jul 2010 23:26:02 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 |
Juanma Barranquero skrev 2010-07-25 19.30:
On Sun, Jul 25, 2010 at 19:23, Randal L. Schwartz<address@hidden> wrote:-extern DIR *opendir (); -extern struct direct *readdir (); +extern DIR *opendir (char *); +extern struct direct *readdir (DIR *);Needs to be backed out, or made more portable.Sure. I'd prefer to make it more portable (that already compiles on Windows / MinGW and Ubuntu / GCC). What is the right prototype in your system? (You didn't attach the error output, BTW). Could you send a patch with the relevant #ifdef?
AFAIK, the correct prototype for opendir is DIR *opendir(const char *);even on Ubunt, as well as OSX and of course POSIX and Single Unix Specification. But on GNU/Linux SYSV_SYSTEM_DIR is defined, but not on OSX. So on GNU/Linux, the wrong prototype is not seen by the compiler.
I think it is an error to extern declare system functions, the proper include file should be used instead. All the #ifdefs that try to figure out if dirent.h (the POSIX-mandated header file for opendir) is present should be replaced with a configure check for dirent.h. Then SYSV_SYSTEM_DIR can go away.
Jan D.
[Prev in Thread] | Current Thread | [Next in Thread] |