Distinguishing "true" MIPS box from DECstation at compile time

Mark Callow msc at ramoth.esd.sgi.com
Tue Dec 19 08:56:08 AEST 1989


In article <89Dec15.145750est.2273 at neat.cs.toronto.edu>,
moraes at cs.toronto.edu (Mark Moraes) writes:
> 
> *Soapbox on*
> 
> It is probably much better to ifdef on specific features that one
> needs (eg.  BSD_SIGNALS, JOB_CONTROL, DIRENT, SHMEM, etc) than on a
> specific vendor type, considering the way the zillion and one
> "standard" deviants, er, variants, of Un*x are growing warts, er,
> features. Relying on even the vendors operating system remaining the
> same is probably not portable. As for the simple distinction between
> BSD and SYSV, that's gone a long time ago, thanks to extensive
> cross-breeding...
> 
> Then one can create configuration headers per machine -- s-machine.h,
> sysdep.h, whatever, defining specific features on a per release basis,
> as is sometimes necessary :-( The joys of maintaining a single source
> tree for multiple architectures and OS deviants!
> 
> *Soapbox off*

Yes, Yes,a thousand times yes.

Even though the system vendors don't define "feature ifdefs" you can write
your code as if you had them.  You simply have to create a header that does
all the ugly stuff (like that in the rest of the referenced article) and
sets the appropriate "featuredefs".

We tried to persuade the X consortium to change the ifdef's in X to a scheme
like this.  Their response was lukewarm.



More information about the Comp.unix.ultrix mailing list