From owner-freebsd-hackers Thu Feb 6 20:27:02 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id UAA02705 for hackers-outgoing; Thu, 6 Feb 1997 20:27:02 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA02691; Thu, 6 Feb 1997 20:26:58 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id PAA19335; Fri, 7 Feb 1997 15:23:06 +1100 Date: Fri, 7 Feb 1997 15:23:06 +1100 From: Bruce Evans Message-Id: <199702070423.PAA19335@godzilla.zeta.org.au> To: bde@zeta.org.au, chuckr@glue.umd.edu Subject: Re: conditionally including Cc: freebsd-ports@FreeBSD.org, hackers@FreeBSD.org, imp@village.org, obrien@NUXI.com Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >> But they certainly should accept anything with __FooBSD__ or BSD >= mmm >> or __FooBSD_version >= nnn. That would give 100-line ifdefs to support >> 100 OS's. It's also useless for communicating what is different in >> FooBSD. > >I don't disagree, I'm just saying that flatly including sys/param.h with >no qualifiers means that it will be a fatal error on any machine that >doesn't have a sys/param.h, so that's not acceptable. The application authors should already have a way of handling the possible nonexistence of sys/param.h, and it is unlikely to be the same as ours. If not, then they should refuse to add anything involving sys/param.h. >non-fatal in nature to systems without sys/param.h. The method I suggest >above is messy, but (and _please_ correct me if I'm wrong) it has the sole >benefit of being the only one I've seen that is non-fatal on systems that >don't have a sys/param.h. I forget what it is. The only method that is (almost) guaranteed to work is a test involving an identifier that is defined outside of the the application, perhaps in bsd.ports.mk, e.g., #ifdef HAVE_SYS_PARAM_H #include #endif This breaks if the identifier already has a different meaning to the application (not likely) and is inconvenient if the application and/or other supported targets already have a different spelling for the identifier. Bruce