From owner-freebsd-current@FreeBSD.ORG Mon Nov 21 17:39:28 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 039A4106564A; Mon, 21 Nov 2011 17:39:28 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 884908FC1F; Mon, 21 Nov 2011 17:39:27 +0000 (UTC) Received: by yenq9 with SMTP id q9so743345yen.13 for ; Mon, 21 Nov 2011 09:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=SlONRK9gfgMCKC1nlR+fu8w2+2BF2hmUNA3VRAVDuJg=; b=pSDZmHQwGxZhoxLxVs9YKVQwRj2Z2rxMkLkBylqtTHvw0gecjJ7Iezldn5ndB5IkbR CaHhb18jHcvcfbM7hcEML7LpFF/LxrA/SzD1KpcIANv/b3/OFlEh1Eg8f8tSfbXrl/KP mdo/EQnGXMjfczKEr3OuK1u/2EUwsYaESsZEw= MIME-Version: 1.0 Received: by 10.50.169.1 with SMTP id aa1mr15646765igc.9.1321897166684; Mon, 21 Nov 2011 09:39:26 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.42.222.200 with HTTP; Mon, 21 Nov 2011 09:39:26 -0800 (PST) In-Reply-To: <20111121092749.GD50300@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> <20111120174807.GY50300@deviant.kiev.zoral.com.ua> <20111121133954.A1108@besplex.bde.org> <20111121092749.GD50300@deviant.kiev.zoral.com.ua> Date: Mon, 21 Nov 2011 18:39:26 +0100 X-Google-Sender-Auth: sYqpNhocR9rVYUbN1EgOH6hCixc Message-ID: From: Robert Millan To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Mon, 21 Nov 2011 17:53:40 +0000 Cc: Adrian Chadd , freebsd-current@freebsd.org, Bruce Evans , 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: Mon, 21 Nov 2011 17:39:28 -0000 (replying with Debian hat this time) 2011/11/21 Kostik Belousov : > There are some implementations that > use FreeBSD kernel, and which could potentially benefit from providing > its own value for __FreeBSD_kernel. Actually, we wouldn't be able to provide a different value for the macro (whatever its name). Our compiler simply doesn't know which version of the kernel it is building for. Only the headers do, but if we define it in the headers we'd just use the FreeBSD definitions. Our compiler defines __FreeBSD_kernel__ as an empty macro, I don't expect this will change because unlike with FreeBSD, on Debian there are strong technical limitations to making it a number. If __FreeBSD_kernel__ is to be defined in FreeBSD land, may I suggest that it is defined as an empty macro as well? This covers the vast majority of cases (e.g. like the ones in my initial patch which started this discussion), and it doesn't preclude the possibility that this macro becomes a number without breaking backward compatibility. OTOH once you define it as a number, it becomes relevant whether you did it with #ifndef or with #undef, and so you have to commit to it. Just to make it clear: It's no problem to me if it's defined as a number, but it doesn't help much either. At least from Debian POV it's not worth making a big argument about. It could be a good idea from FreeBSD POV, but please only do this if it's useful to FreeBSD. -- Robert Millan