From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 10 14:30:11 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60D1516A422 for ; Fri, 10 Feb 2006 14:30:11 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9402E43D76 for ; Fri, 10 Feb 2006 14:30:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1AEU4Su091451 for ; Fri, 10 Feb 2006 14:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1AEU4nm091450; Fri, 10 Feb 2006 14:30:04 GMT (envelope-from gnats) Resent-Date: Fri, 10 Feb 2006 14:30:04 GMT Resent-Message-Id: <200602101430.k1AEU4nm091450@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Robert Millan Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E0D216A420 for ; Fri, 10 Feb 2006 14:24:44 +0000 (GMT) (envelope-from rmh@io.debian.net) Received: from io.debian.net (io.ethz.ch [129.132.80.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26AF043D45 for ; Fri, 10 Feb 2006 14:24:44 +0000 (GMT) (envelope-from rmh@io.debian.net) Received: from rmh by io.debian.net with local (Exim 4.60) (envelope-from ) id 1F7ZCU-000KFz-UG for FreeBSD-gnats-submit@freebsd.org; Fri, 10 Feb 2006 15:24:42 +0100 Message-Id: Date: Fri, 10 Feb 2006 15:24:42 +0100 From: Robert Millan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: gnu/93127: [PATCH] add __FreeBSD_kernel__ to pre-defines X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2006 14:30:11 -0000 >Number: 93127 >Category: gnu >Synopsis: [PATCH] add __FreeBSD_kernel__ to pre-defines >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Feb 10 14:30:03 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Robert Millan >Release: >Organization: >Environment: System: GNU/kFreeBSD io.debian.net 5.4-1-586 #0 Mon Dec 5 19:45:10 CET 2005 i586 i386 AMD-K6(tm) 3D processor GNU/kFreeBSD Architecture: i586 >Description: Please could you consider adding __FreeBSD_kernel__ to the list of gcc pre-defines? This macro is used by GNU/kFreeBSD to allow programs to determine the kernel regardless of its userland. Currently, programs have to check things like this: #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) [ code specific to kernel of FreeBSD ] #endif When FreeBSD defines __FreeBSD_kernel__, it'll be much simpler: #ifdef __FreeBSD_kernel__ [ code specific to kernel of FreeBSD ] #endif >How-To-Repeat: >Fix: Index: contrib/gcc/config/freebsd-spec.h =================================================================== RCS file: /home/ncvs/src/contrib/gcc/config/freebsd-spec.h,v retrieving revision 1.22 diff -u -r1.22 freebsd-spec.h --- contrib/gcc/config/freebsd-spec.h 30 Oct 2005 19:04:47 -0000 1.22 +++ contrib/gcc/config/freebsd-spec.h 10 Feb 2006 14:16:04 -0000 @@ -54,6 +54,7 @@ do \ { \ builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \ + builtin_define ("__FreeBSD_kernel__"); \ builtin_define_std ("unix"); \ builtin_define ("__KPRINTF_ATTRIBUTE__"); \ builtin_assert ("system=unix"); \ >Release-Note: >Audit-Trail: >Unformatted: