Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 May 1997 15:33:07 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        jgrosch@superior.mooseriver.com
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Porting question
Message-ID:  <199705210603.PAA09769@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199705210519.WAA08921@superior.mooseriver.com> from Josef Grosch at "May 20, 97 10:19:11 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/param.h> 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  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705210603.PAA09769>