Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers

From: Kostik Belousov <kostikbel_at_gmail.com>
Date: Sun, 20 Nov 2011 19:48:07 +0200
On Sun, Nov 20, 2011 at 12:40:42PM +0100, Robert Millan wrote:
> On Sat, Nov 19, 2011 at 07:56:20PM +0200, Kostik Belousov wrote:
> > I fully agree with an idea that compiler is not an authorative source
> > of the knowledge of the FreeBSD version. Even more, I argue that we shall
> > not rely on compiler for this at all. Ideally, we should be able to
> > build FreeBSD using the stock compilers without local modifications.
> > Thus relying on the symbols defined by compiler, and not the source
> > is the thing to avoid and consistently remove.
> > 
> > We must do this to be able to use third-party tooldchain for FreeBSD builds.
> > 
> > That said, why not define __FreeBSD_kernel as equal to __FreeBSD_version ?
> > And then make more strong wording about other systems that use the macro,
> > e.g. remove 'may' from the kFreeBSD example.
> > Also, please remove the smile from comment.
> 
> Ok. New patch attached.

And the last, question, why not do
#ifndef __FreeBSD_kernel__
#define __FreeBSD_kernel__ __FreeBSD_version
#endif
?

#undef is too big tools tool apply there, IMO.

Received on Sun Nov 20 2011 - 16:48:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:20 UTC