From owner-freebsd-questions Sun Aug 18 5:26:47 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 2CF3F37B429 for ; Sun, 18 Aug 2002 05:26:35 -0700 (PDT) Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141]) by mx1.FreeBSD.org (Postfix) with ESMTP id B73BC43E4A for ; Sun, 18 Aug 2002 05:26:34 -0700 (PDT) (envelope-from edwin@mavetju.org) Received: from k7.mavetju (topaz.mdcc.cx [212.204.230.141]) by topaz.mdcc.cx (Postfix) with ESMTP id 3BCD22B704; Sun, 18 Aug 2002 14:26:08 +0200 (CEST) Received: by k7.mavetju (Postfix, from userid 1001) id C70A36A7124; Sun, 18 Aug 2002 22:25:28 +1000 (EST) Date: Sun, 18 Aug 2002 22:25:28 +1000 From: Edwin Groothuis To: Gianmarco Giovannelli Cc: questions@freebsd.org Subject: Re: recursive include, why FreeBSD not ? Message-ID: <20020818122528.GD785@k7.mavetju> References: <5.1.1.6.2.20020818112527.0178a268@194.184.65.4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.1.6.2.20020818112527.0178a268@194.184.65.4> User-Agent: Mutt/1.4i 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 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. Edwin -- Edwin Groothuis | Personal website: http://www.MavEtJu.org edwin@mavetju.org | Weblog: http://www.mavetju.org/weblog/weblog.php bash$ :(){ :|:&};: | Interested in MUDs? http://www.FatalDimensions.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message