Subject: suggestion on usage of ifdef's
To: None <tech-kern@NetBSD.ORG>
From: Per Fogelstrom <>
List: tech-kern
Date: 10/07/1995 11:11:25

In several places in the source, both kernel and programs, i often
see ifdef's checking of a particular architecture. This is of course
not entierly wrong but when there is up two two lines of or'ed arch
tests why not create an attribute and turn that on at a central place.
I know it's not feasible with all ifdefs, but many. And particulary
those describing one attribute and used at many places.

One example i recently ran into was in the disklabel program. Since my
MIPS system bots off a dos partition on the hard disk i needed to change
the disklabel program to use the dos partition table code. This code is
conditional by the 'i386' define. If the ifdefs instead used some define
related to the dos partition table the particular code would have been
pulled in automagically. Instead of changing 'n' ifdefs.

Well many words about a small issue, but what do you think?