*BSD News Article 30972


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!agate!ihnp4.ucsd.edu!usc!elroy.jpl.nasa.gov!decwrl!vixie!vixie
From: vixie@vix.com (Paul A Vixie)
Newsgroups: comp.os.386bsd.development
Subject: Re: Request to ``ports'' developers
Date: 28 May 94 22:12:30
Organization: Vixie Enterprises
Lines: 30
Message-ID: <VIXIE.94May28221230@office.home.vix.com>
References: <2s291q$pnl@meatball.rwwa.com> <2s37a4$mp9@pdq.coe.montana.edu>
	<VIXIE.94May27220527@office.home.vix.com> <hm.770154713@hcswork>
NNTP-Posting-Host: office.home.vix.com
In-reply-to: hm@hcswork.hcs.de's message of 28 May 94 19:51:53 GMT

Testing is difficult, but you can generally post the patches somewhere and
some poor soul who's been wanting the software for his system but hadn't the
time||expertise to port it themselves will give you some free(?) testing.
If nothing else, the official author or maintainer of the package will, when
you send your patches back to her (remember that part?) look them over and
either do some testing or put it into the next alpha release of the package.

Feature-based #ifdef's are better, as another person here suggested, but I
didn't want to suggest it since it represents a significant departure from
the way these ports are usually done.  I wanted to recommend a small enough
change from current practice that people would actually think about following
it.  If you want to truly do the right thing, don't "#ifdef POSIX" or even
"#if (BSD >= 199103)" (except in the kernel :-)) -- do something like
"#ifdef NEED_STRDUP" to control the compilation (and declaration, since if
you have to supply it, <string.h> won't be prototyping it for you) of your
own version of strdup().  Then you can just code toward the standards and
implement the parts a particular system doesn't have, and the Makefile can
say something like "add -DNEED_STRDUP to the DEFS= if your system does not
provide that function" in a comment.

But really, using system-style #ifdef's is OK as long as you pick the right
macro.  I really doubt that "__386bsd" is ever the right thing, or "__netbsd"
or "__freebsd", or "__bsdi__", since I don't think those systems add anything
new to the basic (BSD >= 199103) interface.  So if you use the common #ifdef
you essentially get those other "ports" for free.
--
Paul Vixie
Redwood City, CA
decwrl!vixie!paul
<paul@vix.com>