Date: Mon, 1 Jan 1996 18:04:29 +1100 From: Bruce Evans <bde@zeta.org.au> To: lyndon@orthanc.com, pw@snoopy.mv.com Cc: hackers@FreeBSD.org Subject: Re: libraries Message-ID: <199601010704.SAA25177@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>>>>>> "lyndon" == VE7TCP <Lyndon> writes: >>>>>> "John" == John Beukema <john@gateway.net.hk> 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 <sys/param.h> #if (!defined(BSD) || (BSD < > lyndon> 199306) /* define sys_errlist as appropriate for your > lyndon> system */ #endif >So, <sys/param.h> 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 <sys/param.h> >/* 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601010704.SAA25177>