From owner-freebsd-hackers Tue May 20 23:05:02 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA21118 for hackers-outgoing; Tue, 20 May 1997 23:05:02 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA21090 for ; Tue, 20 May 1997 23:04:39 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id PAA09769; Wed, 21 May 1997 15:33:08 +0930 (CST) From: Michael Smith Message-Id: <199705210603.PAA09769@genesis.atrad.adelaide.edu.au> Subject: Re: Porting question In-Reply-To: <199705210519.WAA08921@superior.mooseriver.com> from Josef Grosch at "May 20, 97 10:19:11 pm" To: jgrosch@superior.mooseriver.com Date: Wed, 21 May 1997 15:33:07 +0930 (CST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Josef Grosch stands accused of saying: > I know this issue has been beat to death several times before BUT..... > > I am porting a piece of code to FreeBSD and gcc bitches about this; > > extern char* sys_errlist[]; > > Now the fast way to handle this is; > > #ifndef __FreeBSD__ > extern char* sys_errlist[]; > #endif > > But this is very non-portable. Any suggestions as the correct way to > handle this would be helpful. Traditional is #ifndef HAVE_SYS_ERRLIST extern char* sys_errlist[]; #endif or, if you can guarantee that has been included, you can test the BSD macro. > Josef Grosch | Another day closer to a | FreeBSD 2.2.1 -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[