Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jul 2000 16:02:51 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Wilbert de Graaf <wilbertdg@hetnet.nl>
Cc:        FreeBSD-hackers <FreeBSD-hackers@FreeBSD.ORG>
Subject:   Re: #include question: <netinet/in.h> requires <sys/socket.h>
Message-ID:  <20000713160251.Z25571@fw.wintelcom.net>
In-Reply-To: <396E49D4.DBBA9B5C@hetnet.nl>; from wilbertdg@hetnet.nl on Thu, Jul 13, 2000 at 03:59:32PM -0700
References:  <095401bfec6f$495ba110$0a00a8c0@alias> <20000712221526.L25571@fw.wintelcom.net> <396E49D4.DBBA9B5C@hetnet.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
* Wilbert de Graaf <wilbertdg@hetnet.nl> [000713 15:59] wrote:
> 
> Alfred Perlstein wrote:
> 
> > >
> > > somewhere in the top of <netinet/in.h>. I want to verify if this is indeed
> > > the best way to solve it ?
> > 
> > No, the proper solution is to do a forward struct declaration like so:
> > 
> > struct something;
> > 
> > struct bigger_something {
> >         struct something foo;
> > }
> 
> As we discussed offline Alfred,  I would post this didn't work unless it
> was
> 
> struct bigger_something {
>         struct something *foo;
> }
> 
> but I cannot change the structure that had to be added to
> <netinet/in.h>. So 
> it's probably going to be the #fndef _SYS_SOCKET_H.

you might as well unconditionally include sys/socket.h and let it's
internal #ifndef take care of that problem.

I'm not sure why you don't just make your own new header file for
this struct unless you're adding to an existing structure in
socket.h, even if you are you can put whatever it is that you added
to netinet/in.h into a seperate header or sys/socket.h itself.

-Alfred


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000713160251.Z25571>