From owner-freebsd-hackers Fri Apr 11 19:44:59 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id TAA09705 for hackers-outgoing; Fri, 11 Apr 1997 19:44:59 -0700 (PDT) Received: from cheops.anu.edu.au (avalon@cheops.anu.edu.au [150.203.76.24]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA09699 for ; Fri, 11 Apr 1997 19:44:55 -0700 (PDT) Message-Id: <199704120244.TAA09699@freefall.freebsd.org> Received: by cheops.anu.edu.au (1.37.109.16/16.2) id AA034102651; Sat, 12 Apr 1997 12:37:31 +1000 From: Darren Reed Subject: Re: detecting kernel version at compile time To: terry@lambert.org (Terry Lambert) Date: Sat, 12 Apr 1997 12:37:31 +1000 (EST) Cc: hackers@freebsd.org In-Reply-To: <199704110018.RAA10243@phaeton.artisoft.com> from "Terry Lambert" at Apr 10, 97 05:18:14 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In some mail from Terry Lambert, sie said: > > > Lets see...firstly, there is which is particular to FreeBSD. > > Including that file always requires #ifdef's for FreeBSD. Now you want > > to introduce . That is going to be conditional on what > > is in . THen code which currently checks for __FreeBSD_version > > must be adapted to see if __FreeBSD_sysversion exists. > > 1) files can *never* depend on files. > 2) You only have to check the version if you want to protect > against a crash better than you currently do. > > Why weren't __FreeBSD_version & __FreeBSD_sysversion (IF you need both) put > > in ? For starters, one doesn't need to worry about extra > > include files, although removing would not be good, now. > > I don't know; I've never used . It really only applies > to the installation insteance of the toolset, and the instances of the > API enacted by the standard (not system) include files, IMO. > > It seems to me that it's a concession to vendors who don't want to check > the BSD manifest constants across BSD platforms. Given this, are there any objections from anyone about putting __FreeBSD_sysversion in ? As for the BSD symbols, I use them wherever possible. > You can't possibly have a system component that reference , > since it's not accessable in the kernel build environment (this is the > problem he is talking about addressing). Hmmm, can __FreeBSD_sysversion be made the same value as __FreeBSD_version ? (or vice versa) > > Further still, there is the uselessness of __FreeBSD__ in some > > circumstances. > > That would be those vendor circumstances where vendors want all BSD's > to standardize on the same interfaces. The problem with __FreeBSD__ is that it is defined by cc - or gcc/pgcc. That is, it depends on what system the compiler is built, not what OS it is running on. Problem being, it impacts every compilation thereafter.