From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?SmFuIERqw6Rydg==?= Newsgroups: gmane.emacs.devel Subject: Re: recent commit broke src/dired.c on OSX Date: Sun, 25 Jul 2010 23:26:02 +0200 Message-ID: <4C4CABEA.4040005@swipnet.se> References: <86iq4379w0.fsf@red.stonehenge.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1280093184 9606 80.91.229.12 (25 Jul 2010 21:26:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 25 Jul 2010 21:26:24 +0000 (UTC) Cc: emacs-devel@gnu.org, "Randal L. Schwartz" To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 25 23:26:22 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Od8iC-0002Ch-Vl for ged-emacs-devel@m.gmane.org; Sun, 25 Jul 2010 23:26:22 +0200 Original-Received: from localhost ([127.0.0.1]:32924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Od8i8-0000Ih-Nr for ged-emacs-devel@m.gmane.org; Sun, 25 Jul 2010 17:26:16 -0400 Original-Received: from [140.186.70.92] (port=59198 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Od8i2-0000G2-FC for emacs-devel@gnu.org; Sun, 25 Jul 2010 17:26:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Od8hw-000525-RW for emacs-devel@gnu.org; Sun, 25 Jul 2010 17:26:06 -0400 Original-Received: from smtprelay-h32.telenor.se ([213.150.131.5]:41679) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Od8hw-00051q-Li for emacs-devel@gnu.org; Sun, 25 Jul 2010 17:26:04 -0400 Original-Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-h32.telenor.se (Postfix) with ESMTP id 5EBDDE8D83 for ; Sun, 25 Jul 2010 23:26:03 +0200 (CEST) X-SENDER-IP: [85.225.45.35] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aro8AE5ITExV4S0jPGdsb2JhbACDFIRSl3kMAQEBATUtrxWQIoEmgx1zBA X-IronPort-AV: E=Sophos;i="4.55,259,1278280800"; d="scan'208";a="110489818" Original-Received: from c-232de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.35]) by ipb1.telenor.se with ESMTP; 25 Jul 2010 23:26:03 +0200 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 652317FA05A; Sun, 25 Jul 2010 23:26:02 +0200 (CEST) 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 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:127804 Archived-At: Juanma Barranquero skrev 2010-07-25 19.30: > On Sun, Jul 25, 2010 at 19:23, Randal L. Schwartz 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.