gnu/93127: [PATCH] add __FreeBSD_kernel__ to pre-defines

Robert Millan rmh at aybabtu.com
Fri Feb 10 06:30:11 PST 2006


>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:


More information about the freebsd-bugs mailing list