From owner-freebsd-hackers Wed Jan 31 23:51:51 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id XAA03328 for hackers-outgoing; Wed, 31 Jan 1996 23:51:51 -0800 (PST) Received: from puli.cisco.com (puli.cisco.com [171.69.1.174]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id XAA03304 Wed, 31 Jan 1996 23:51:46 -0800 (PST) Received: from localhost.cisco.com (localhost.cisco.com [127.0.0.1]) by puli.cisco.com (8.6.8+c/8.6.5) with SMTP id XAA11280; Wed, 31 Jan 1996 23:50:36 -0800 Message-Id: <199602010750.XAA11280@puli.cisco.com> To: Greg Lehey Cc: hackers@FreeBSD.org, ports@FreeBSD.org Subject: Re: Another Pentium gcc patch, -D__FreeBSD__=2 -Dbsd4_4 In-Reply-To: Your message of "Thu, 01 Feb 1996 08:35:18 +0700." <199602010739.IAA25585@nixpbe.pdb.sni.de> Date: Wed, 31 Jan 1996 23:50:36 -0800 From: Paul Traina Sender: owner-hackers@FreeBSD.org Precedence: bulk From: Greg Lehey Subject: Re: Another Pentium gcc patch, -D__FreeBSD__=2 -Dbsd4_4 > > I don't think our current gcc defines bsd4_4, I'm certain it shouldn't. :-) > There's a well defined way to find out what version of the OS you're runnin >>g > under. > > #ifdef _HAVE_PARAM_H > #include > #endif > > #if defined(BSD) && (BSD >= datecode) > ... > #endif > > This gives us much finer grained control. How does this distinguish between BSD/OS, NetBSD and FreeBSD? How does it distinguish between FreeBSD 2.1 and FreeBSD 2.2? What this really tells you is what version of the compiler or header files you have. The big mistake most porters make is they TRY to distinguish us from NetBSD and BSD/OS. Most "freebsd" distinctions are really 4.4 and later distinctions and should use the BSD define. That's why you should use the sys/param.h method, becuase it's what everyone decided on as the STANDARD way to do this. If you gratuitously define bsd4_4 in the compiler and have programs rely on it, then you're not doing anyone any favors. I know, it's a pain in the ass to use the method I mentioned (see quote above), but it's correct. When you need to get finer grained than the standard, then use: __NetBSD__ __FreeBSD__ or __FreeBSD__== or bsdi I think that the gcc *should* define bsd4_4 (or similar). There's plenty of software out there which doesn't care which 4.4BSD-derived system you're running, and this would help, just like __386bsd__ used to be useful. We're in violent agreement about your second sentence, disagreement about your first. The "portable" method has already been defined, and it's not the one you chose. I don't like it either, but I live with it. Sorry, Paul