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

看板FB_current作者時間14年前 (2011/11/18 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串7/24 (看更多)
On Thursday, November 17, 2011 1:46:33 am Robert Millan wrote: > 2011/11/16 Warner Losh <imp@bsdimp.com>: > > My second reaction was why not have > > > > #ifndef __FreeBSD_kernel__ > > #define __FreeBSD_kernel__ __FreeBSD__ > > #endif > > > > in sys/param.h and then just change __FreeBSD__ to __FreeBSD_kernel__ in the headers that are affected? But I'm not quite sure what effects that would have on your environment. > > I'm fine with this. > > > Why do you think people wouldn't be fond of the __FreeBSD_kernel__ being defined? > > See archived discussion: > > http://lists.freebsd.org/pipermail/freebsd-hackers/2011-July/035721.html > > particularly this mail in which you participated: > > http://lists.freebsd.org/pipermail/freebsd-hackers/2011-July/035823.html I recall the discussion from earlier. I can't recall if I had replied to it though. :-/ In my current opinion, I think it would be fine to define __FreeBSD_kernel__ on FreeBSD and to do it in <sys/param.h> for now until all the compilers we use have been updated to define it automatically (which may be a long time). I think it will also be fine to patch in-system headers to use __FreeBSD_kernel__ once <sys/param.h> is defined. Unfortunately headers in 3rd party software are going to have to check for both __FreeBSD__ and __FreeBSD_kernel__ to support both GNU/kFreeBSD and older FreeBSD for the foreseeable future. I think that is fine, but that the sooner we add __FreeBSD_kernel__ on FreeBSD the sooner we get the clock started for a day when those extra checks can go away. I would also be fine with MFC'ing the addition of __FreeBSD_kernel__ to older branches (at least 7 - 9) as well. -- John Baldwin _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1EnKlVvc (FB_current)
討論串 (同標題文章)
完整討論串 (本文為第 7 之 24 篇):
文章代碼(AID): #1EnKlVvc (FB_current)