Date: Wed, 16 Nov 2011 11:33:30 -0700 From: Warner Losh <imp@bsdimp.com> To: Robert Millan <rmh@freebsd.org> Cc: Kostik Belousov <kostikbel@gmail.com>, Adrian Chadd <adrian@freebsd.org>, freebsd-current@freebsd.org, d@delphij.net, freebsd-arch@freebsd.org Subject: Re: [PATCH] Detect GNU/kFreeBSD in user-visible kernel headers Message-ID: <A19D5135-57FF-465C-B506-F194896B2599@bsdimp.com> In-Reply-To: <CAOfDtXO5FcNv2=%2BLr4m-OVGpkL9Y703yGpQ%2B_fdKFpT_PaRa2g@mail.gmail.com> References: <CAOfDtXPX1Rv9T7%2B1jYQbkM14tRY7mqgCzPcUqvHxFaRObbwvEg@mail.gmail.com> <4EC3FBD2.4070009@delphij.net> <CAOfDtXO5FcNv2=%2BLr4m-OVGpkL9Y703yGpQ%2B_fdKFpT_PaRa2g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 16, 2011, at 11:26 AM, Robert Millan wrote: > 2011/11/16 Xin LI <delphij@delphij.net>: >> Just my $0.02 -- I think we should probably do it in a more >> centralized place -- otherwise in case someone imported some new = code, >> they have to do the same defined(__FreeBSD__) || >> defined(__FreeBSD_kernel__)? >=20 > How about something like: >=20 > #if defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) > #define __FreeBSD_kernel__ > #endif >=20 > it can be placed at beginning of each header, then the rest becomes > much simpler. >=20 > Note this has the side-effect of defining __FreeBSD_kernel__ on > FreeBSD, which I suspect some people won't be fond of. An alternative > could be to come up with an ad-hoc macro that means "this system is > either FreeBSD or uses the same kernel as FreeBSD" and define it where > needed. I had a similar suggestion... Why do you think people wouldn't be fond of the __FreeBSD_kernel__ being = defined? Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A19D5135-57FF-465C-B506-F194896B2599>