From owner-freebsd-hackers Sun Dec 31 23:10:09 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id XAA10765 for hackers-outgoing; Sun, 31 Dec 1995 23:10:09 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id XAA10731 for ; Sun, 31 Dec 1995 23:09:58 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id SAA25177; Mon, 1 Jan 1996 18:04:29 +1100 Date: Mon, 1 Jan 1996 18:04:29 +1100 From: Bruce Evans Message-Id: <199601010704.SAA25177@godzilla.zeta.org.au> To: lyndon@orthanc.com, pw@snoopy.mv.com Subject: Re: libraries Cc: hackers@FreeBSD.org Sender: owner-hackers@FreeBSD.org Precedence: bulk >>>>>> "lyndon" == VE7TCP writes: >>>>>> "John" == John Beukema writes: > John> This error is a commonn problem. Comment it out in httcp.c > John> or add #ifndef __FreeBSD__ #endif (from memory) around the > John> declaration. One is defined as char * and the other as > John> const char * as I remember. jbeukema > lyndon> The correct fix for sys_errlist declarations is: > lyndon> #include #if (!defined(BSD) || (BSD < > lyndon> 199306) /* define sys_errlist as appropriate for your > lyndon> system */ #endif >So, is present on all systems that have a C compiler >or just systems with compilers that define the 'unix' macro, or just >BSD derived systems? Of course not. >Does one need >#if defined __FreeBSD__ || defined __listOfOthersKnownToHaveParam_ .. >#include >/* tests for various flavors of BSD go here */ >#endif This is impractical. The list would have to have a few thousand systems in it, and you wouldn't work on thise systems that don't identify themselves. >Offhand, it looks like the OS dependent feature is hidden in an OS >dependent file. It seems to me that the compiler ought to emit the >root feature list in some standard way so that codes can have some >predictable behaviour. This is impractical. The feature list would have to have a few thousand flags in it, and wouldn't work on those systems that don't support it. The correct method to handle this is to generate the feature lists on the fly like gnu autoconf does. However, this is too much trouble for a port. Just use `#if 0', perhaps with a comment, or #ifdef this_is_unportable_and_I_am_too_lazy_to_make_it_portable or the original #ifndef __FreeBSD__ The latter has the advantage that it is usually spelled consistently so you can find it easily. Bruce