From owner-freebsd-current@FreeBSD.ORG Sun Nov 20 17:48:17 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E48B71065670; Sun, 20 Nov 2011 17:48:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 57F908FC08; Sun, 20 Nov 2011 17:48:17 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pAKHm71M046366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Nov 2011 19:48:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pAKHm7MI031145; Sun, 20 Nov 2011 19:48:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pAKHm7nr031144; Sun, 20 Nov 2011 19:48:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 20 Nov 2011 19:48:07 +0200 From: Kostik Belousov To: Robert Millan Message-ID: <20111120174807.GY50300@deviant.kiev.zoral.com.ua> References: <201111170959.56767.jhb@freebsd.org> <201111171632.34979.jhb@freebsd.org> <20111119175620.GV50300@deviant.kiev.zoral.com.ua> <20111120114042.GA1256@thorin> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Wf9W8POIGIHIPm/L" Content-Disposition: inline In-Reply-To: <20111120114042.GA1256@thorin> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Adrian Chadd , freebsd-current@freebsd.org, Warner Losh , freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 17:48:18 -0000 --Wf9W8POIGIHIPm/L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 20, 2011 at 12:40:42PM +0100, Robert Millan wrote: > On Sat, Nov 19, 2011 at 07:56:20PM +0200, Kostik Belousov wrote: > > I fully agree with an idea that compiler is not an authorative source > > of the knowledge of the FreeBSD version. Even more, I argue that we sha= ll > > not rely on compiler for this at all. Ideally, we should be able to > > build FreeBSD using the stock compilers without local modifications. > > Thus relying on the symbols defined by compiler, and not the source > > is the thing to avoid and consistently remove. > >=20 > > We must do this to be able to use third-party tooldchain for FreeBSD bu= ilds. > >=20 > > That said, why not define __FreeBSD_kernel as equal to __FreeBSD_versio= n ? > > And then make more strong wording about other systems that use the macr= o, > > e.g. remove 'may' from the kFreeBSD example. > > Also, please remove the smile from comment. >=20 > Ok. New patch attached. And the last, question, why not do #ifndef __FreeBSD_kernel__ #define __FreeBSD_kernel__ __FreeBSD_version #endif ? #undef is too big tools tool apply there, IMO. --Wf9W8POIGIHIPm/L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7JPVYACgkQC3+MBN1Mb4gSRgCdGTjCg5VHRaGSDqLIZEzpDHy6 THEAoOu96w8IHK1UsmOqzZS/S/sIDFdj =LGeQ -----END PGP SIGNATURE----- --Wf9W8POIGIHIPm/L--