From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 02:19:16 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7F1D106566B for ; Sun, 3 Jul 2011 02:19:16 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5408FC0C for ; Sun, 3 Jul 2011 02:19:16 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Sat, 2 Jul 2011 22:08:27 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id A43C833C02; Sat, 2 Jul 2011 22:08:27 -0400 (EDT) Date: Sat, 2 Jul 2011 22:08:27 -0400 From: Ed Maste To: Alexander Kabaev Message-ID: <20110703020827.GA5763@sandvine.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20110702193724.5c55a6c9@kan.dnsalias.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, Robert Millan Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 02:19:16 -0000 On Sat, Jul 02, 2011 at 07:37:24PM -0400, Alexander Kabaev wrote: > On Sat, 2 Jul 2011 17:41:03 +0200 > Robert Millan wrote: > > > My request is that FreeBSD also defines __FreeBSD_kernel__. If this > > happens, life would be made a bit easier on both sides, as it'd be > > more natural for porters of either system to support both using a > > single macro [1]. I think this is a good idea, especially if it means that a single change can make it into upstream projects to support both FreeBSD and Debian kFreeBSD. > I do not think this belongs in GCC at all. You should already have a > defined symbol to identify your OS and that should be used in cases > where it matters. I suspect the proposed patch put it in GCC based on the fact that we already have __FreeBSD__ in contrib/gcc/config/freebsd-spec.h: builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \ > Alternatively, you should provide the symbol in > similar way in which we provide __FreeBSD_version, through well-known > header like sys/param.h and not pollute GCC. I suspect this is probably a reasonable alternative, but may mean software will have to pick up an additional #include. Out of curiosity, what is the canonical way for software to identify a Linux kernel -- __linux__ or some variant? Where is it defined? Regards, Ed Maste