Subject: Re: Protecting the rest of the kerner headers against multiple inclusion
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 09/10/1999 21:13:57
In article <199909102100.RAA499016@antharia.mit.edu>,
Dan Winship <danw@MIT.EDU> wrote:
>If you're going to go through all the kernel includes, it would be
>cool to standardize some of the ones that already are protected:
>looking through sys/arch/i386/include, for instance, some files check
>a define with just the filename (_VMPARAM_H_), some with the arch name
>and filename (_I386_SYSARCH_H_), some with "machine" and the filename
>(_MACHINE_ENDIAN_H_), and some with some vaguely random permutation of
>one of the above (_MACHTYPES_H_ for types.h).

The proposal is to have the last component of the path for MI code
and the machine name for MD code.

MI: _SYS_TYPES_H_ _NETINET_IN_H_

MD: _I386_TYPES_H_ _I368_ENDIAN_H_ *OR*
MD: _MACHINE_TYPES_H_ _MACHINE_ENDIAN_H_ 

I think that the first is better for MD code, the disadvantage being that
you will be able to include MD files from multiple archs... But that is
screwed up anyway, and should be allowed if you know what you are doing.

christos