From owner-freebsd-questions Sun Aug 18 5:44:24 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 395CA37B400 for ; Sun, 18 Aug 2002 05:44:10 -0700 (PDT) Received: from cecov.masternet.it (cecov.masternet.it [194.184.65.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65EE243E6A for ; Sun, 18 Aug 2002 05:44:09 -0700 (PDT) (envelope-from gmarco@scotty.masternet.it) Received: from usul.scotty.masternet.it (freebsd.giovannelli.com [194.184.65.139]) by cecov.masternet.it (8.11.6/8.11.6) with ESMTP id g7ICnBL96204; Sun, 18 Aug 2002 14:49:12 +0200 (CEST) (envelope-from gmarco@scotty.masternet.it) Message-Id: <5.1.1.6.2.20020818144206.020f9ef0@194.184.65.7> X-Sender: gmarco@194.184.65.7 X-Mailer: QUALCOMM Windows Eudora Version 5.1.1 Date: Sun, 18 Aug 2002 14:44:47 +0200 To: Edwin Groothuis , Gianmarco Giovannelli From: Gianmarco Giovannelli Subject: Re: recursive include, why FreeBSD not ? Cc: questions@FreeBSD.ORG In-Reply-To: <20020818122528.GD785@k7.mavetju> References: <5.1.1.6.2.20020818112527.0178a268@194.184.65.4> <5.1.1.6.2.20020818112527.0178a268@194.184.65.4> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 18/08/2002, Edwin Groothuis wrote: >On Sun, Aug 18, 2002 at 11:32:47AM +0200, Gianmarco Giovannelli wrote: > > I have a piece of code like this: > > > > #if defined(__OpenBSD__) > > #define __BYTE_ORDER BYTE_ORDER > > #define __LITTLE_ENDIAN LITTLE_ENDIAN > > #define __BIG_ENDIAN BIG_ENDIAN > > #endif > > > > [...] > > > > #if defined(__FreeBSD__) > > #include > > #define __BYTE_ORDER BYTE_ORDER > > #define __LITTLE_ENDIAN LITTLE_ENDIAN > > #define __BIG_ENDIAN BIG_ENDIAN > > #endif > > > > > > If I remove the: > > #include > > it doesn't compile while OpenBSD and Linux compile clean... > >Linux has the obsession of including include-files in the include >files itself. For example, sys/socket.h includes sys/types.h(*) > >FreeBSD doesn't include that sys/types.h in sys/socket.h, therefor >it will fail to compile. > >I don't know who is right, but if the man-page tells me to include >sys/types.h and sys/socket.h I will do it that way and not the other >way around and neither only sys/socket.h. > >(*) It might (or might not) be sys/types.h and sys/socket.h, but > that is the one which I think it was. I have had the same > experience a couple of times before. Tnx for your kind reply... Btw it seems not only Linux use the self inclusion. Also OpenBSD seems to act in this way, even if I really prefer the explicit way of doing things. Another question: but should this be a compiler (gcc) or OS dependant thing ??? Best Regards, Gianmarco Giovannelli , "Unix expert since yesterday" http://www.gufi.org/~gmarco To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message