From owner-freebsd-questions Wed Jan 10 7:53:59 2001 Delivered-To: freebsd-questions@freebsd.org Received: from xena.gsicomp.on.ca (cr677933-a.ktchnr1.on.wave.home.com [24.43.230.149]) by hub.freebsd.org (Postfix) with ESMTP id 0DEF637B6C5 for ; Wed, 10 Jan 2001 07:53:15 -0800 (PST) Received: from hermes (hermes.gsicomp.on.ca [192.168.0.18]) by xena.gsicomp.on.ca (8.9.3/8.9.3) with SMTP id KAA54977; Wed, 10 Jan 2001 10:52:22 -0500 (EST) (envelope-from matt@gsicomp.on.ca) Message-ID: <00b401c07b1d$70799c60$1200a8c0@gsicomp.on.ca> From: "Matthew Emmerton" To: "Geoffrey Crompton (RMIT Guest)" Cc: "FreeBSD-Questions" References: <20010110121911.A29635@gecko.eric.net.au> <20010110165043.A31845@gecko.eric.net.au> Subject: Re: programming in freebsd related questions Date: Wed, 10 Jan 2001 10:53:10 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Tue, Jan 09, 2001 at 08:25:38PM -0500, Matthew Emmerton wrote: > > On Wed, 10 Jan 2001, Geoffrey Crompton (RMIT Guest) wrote: > > > > > When I #include things like sys/socket.h and netinet/in.h, I get heaps > > > of compiler errors, unless I do a #include before I #include > > > the others. Why is that? > > > > Because that's the way it is. defines many things that are > > used by other header files, such as and , so > > you have to include it first, as you've found out. Depending on your > > program, you may need to include _instead of_ > > . (You can't include both.) > > Is there a design reason for why those files (, ) > don't #include ? Or is that just that way it is? Since may need to be included instead of , depending on the project, the other headers can't infer which is needed. That's why they don't auto-include it. > Does define a superset of what is defined in ? Yes. includes as well as certain system-dependant parameters (system version, system maxiums, etc.) -- Matt Emmerton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message