From owner-freebsd-current Tue Jan 27 12:41:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA04405 for current-outgoing; Tue, 27 Jan 1998 12:41:38 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA04383 for ; Tue, 27 Jan 1998 12:41:34 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id MAA04895; Tue, 27 Jan 1998 12:35:25 -0800 (PST) Received: from UNKNOWN(), claiming to be "current1.whistle.com" via SMTP by alpo.whistle.com, id smtpd004891; Tue Jan 27 12:35:20 1998 Message-ID: <34CE4438.15FB7483@whistle.com> Date: Tue, 27 Jan 1998 12:31:52 -0800 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.2.5-RELEASE i386) MIME-Version: 1.0 To: dg@root.com CC: Terry Lambert , current@FreeBSD.ORG Subject: Re: PATCH: if_de.c #ifdef based version encoding References: <199801271101.DAA25275@implode.root.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk David Greenman wrote: > > >The value of the manifest constant __FreeBSD__ is derived from the > >compiler tools and not from the kernel being built. > > > >In other words, the value of __FreeBSD__ comes from the version of the > >OS the tools were built on, not from the OS that's running or the one > >that is being targeted. > > > >This means that if I build a v3 kernel using a v2 system's tools, the > >"#if __FreeBSD__ >= 3" and "#if defined(__FreeBSD__) && __FreeBSD__ >= 3" > >will not test true, even though that is, in fact, what I am building. > > > > > >Version information should not be encoded in #ifdef's; that is what > >branch tags are for. If I can check this code out, implicitly, I am > >building a 3+ system. The "#if" tests are bogus. > > > >This patch allows people to compile v3 kernels containing if_de.c on v2 > >systems. > > > >Please commit it. The problem occurs as I discovered yesterday when upgrading 2.2.x to 3.x a very simple fix that would allow Matt to have his driver (mostly) unmodified, would be: to check in, in the 3.0 branch, the following: #undef __FreeBSD__ #define __FreeBSD__ 3 > > In theory, the de driver is maintained by Matt Thomas and he supports > multiple OS's and OS versions in the code. You'll notice that there are > #ifdef's for NetBSD and BSD/OS in there as well. If we were going to do > as you suggest, then it would only make sense if all of the OS #ifdef's > were removed. This will only make it more difficult for Matt to support > FreeBSD, so I think it's a bad idea. ok, then how about this small 'hack' > > -DG > > David Greenman > Core-team/Principal Architect, The FreeBSD Project