Subject: Re: problems with arpa/inet.h
To: None <, scottr@Plexus.COM>
From: Olaf Seibert <>
List: current-users
Date: 06/11/1998 12:53:20 wrote:
> On Wed, 10 Jun 1998 wrote:
> > This is no argument. If a header A should be included before header B,
> > because B uses something from A, then it doesn't matter for the amount
> > of preprocessed output if A is included by B, or by the main program.
> This is not necessarily true, but in the particular case of arpa/inet.h,
> it certainly is.  Thanks for pointing out my error.

I'll admit that if A is included from both B and the main program, and
if A has the canonical multiple-inclusion protection, but the
preprocessor does not detect that, there might be difference in the
amount of whitespace, and/or #line directives.

To overcome this, one could do a double protection, as in the AmigaOS
system header files:

<exec/types.h> is:

    #ifndef EXEC_TYPES_H
    #define EXEC_TYPES_H
    ...all type definitions...

<exec/exec.h> contains:

    #ifndef EXEC_TYPES_H
    #include <exec/types.h>

This is slightly more typing work but works optimally with every
C preprocessor. (obNetBSD) I would not be against such a construct in
the NetBSD headers.

> --scott
___ Olaf 'Rhialto' Seibert                D787B44DFC896063 4CBB95A5BD1DAA96 
\X/ * You are not expected to understand this.