Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jul 2011 17:41:03 +0200
From:      Robert Millan <rmh@debian.org>
To:        freebsd-hackers@freebsd.org, Ed Maste <emaste@freebsd.org>
Subject:   [PATCH] __FreeBSD_kernel__
Message-ID:  <CAOfDtXPUxQO1zbnxh8sh%2By7g=d8QaH2svYtEQJ06L4d%2BQKG8VA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--bcaec51ddbf73038f704a717f60c
Content-Type: text/plain; charset=UTF-8

Since their inception, GNU/kFreeBSD systems had defined
"__FreeBSD_kernel__" as builtin macro to indicate this is a system
that uses the kernel of FreeBSD.  We couldn't define "__FreeBSD__"
because this implies a full FreeBSD system, and a lot of software
checks for this macro when it is concerned with userland (usually
libc).

As a result of this, and of the considerable porting effort that
followed, many 3rd party programs with kernel-specific extensions have
been ported to recognize __FreeBSD_kernel__ as well. E.g.:

#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
// code for FreeBSD kernel
#endif

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].

[1] When porting software to support FreeBSD and systems with kernel
of FreeBSD myself (as I did with e.g. GRUB), I generally took care to
ensure both macros are checked for, but this isn't always the case.
Having a unified macro would make it easier for developers of both
systems to cooperate.

-- 
Robert Millan

--bcaec51ddbf73038f704a717f60c
Content-Type: text/plain; charset=US-ASCII; name="freebsd_kernel.diff"
Content-Disposition: attachment; filename="freebsd_kernel.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gpmqj6e20

SW5kZXg6IGNvbnRyaWIvZ2NjL2NvbmZpZy9mcmVlYnNkLXNwZWMuaAo9PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBj
b250cmliL2djYy9jb25maWcvZnJlZWJzZC1zcGVjLmgJKHJldmlzaW9uIDIyMzcyMSkKKysrIGNv
bnRyaWIvZ2NjL2NvbmZpZy9mcmVlYnNkLXNwZWMuaAkod29ya2luZyBjb3B5KQpAQCAtNTQsNiAr
NTQsNyBAQAogICBkbwkJCQkJCQkJCVwKICAgICB7CQkJCQkJCQkJXAogCWJ1aWx0aW5fZGVmaW5l
X3dpdGhfaW50X3ZhbHVlICgiX19GcmVlQlNEX18iLCBGQlNEX01BSk9SKTsJXAorCWJ1aWx0aW5f
ZGVmaW5lICgiX19GcmVlQlNEX2tlcm5lbF9fIik7CQkJCVwKIAlidWlsdGluX2RlZmluZV9zdGQg
KCJ1bml4Iik7CQkJCQlcCiAJYnVpbHRpbl9kZWZpbmVfc3RkICgiX191bml4X18iKTsJCQkJXAog
CWJ1aWx0aW5fZGVmaW5lICgiX19LUFJJTlRGX0FUVFJJQlVURV9fIik7CQkJXAo=
--bcaec51ddbf73038f704a717f60c--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfDtXPUxQO1zbnxh8sh%2By7g=d8QaH2svYtEQJ06L4d%2BQKG8VA>