From owner-freebsd-arch@FreeBSD.ORG Wed Nov 16 18:40:36 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C22FF106566B; Wed, 16 Nov 2011 18:40:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6C3998FC21; Wed, 16 Nov 2011 18:40:36 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pAGIWdJE001766 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 16 Nov 2011 11:33:37 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Wed, 16 Nov 2011 11:33:30 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4EC3FBD2.4070009@delphij.net> To: Robert Millan X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Wed, 16 Nov 2011 11:33:38 -0700 (MST) Cc: Kostik Belousov , Adrian Chadd , freebsd-current@freebsd.org, d@delphij.net, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 18:40:36 -0000 On Nov 16, 2011, at 11:26 AM, Robert Millan wrote: > 2011/11/16 Xin LI : >> Just my $0.02 -- I think we should probably do it in a more >> centralized place -- otherwise in case someone imported some new = code, >> they have to do the same defined(__FreeBSD__) || >> defined(__FreeBSD_kernel__)? >=20 > How about something like: >=20 > #if defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) > #define __FreeBSD_kernel__ > #endif >=20 > it can be placed at beginning of each header, then the rest becomes > much simpler. >=20 > Note this has the side-effect of defining __FreeBSD_kernel__ on > FreeBSD, which I suspect some people won't be fond of. An alternative > could be to come up with an ad-hoc macro that means "this system is > either FreeBSD or uses the same kernel as FreeBSD" and define it where > needed. I had a similar suggestion... Why do you think people wouldn't be fond of the __FreeBSD_kernel__ being = defined? Warner