Re: #ifdef INET6

看板DFBSD_kernel作者時間21年前 (2004/12/15 07:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
:Hey guys, : : I was fixing up some bad code in logger(1) and came across: : :94 #ifdef INET6 :95 case '6': :96 family = PF_INET6; :97 break; :98 #endif : :Now we should do something similar to the actual optstring of getopt. :Although, talking to Joerg he has a strong dislike for INET6 within :userland. Whats the stand on this? : :-- :Liam J. Foy :<liamfoy@sepulcrum.org> :Say it in the living years... Well, the above statement could very easily be rewritten like this, if portability is required: case 6: #ifdef PF_INET6 family = PF_INET6; break; #else warn("ipv6 not currently supported"); break; #endif In userland there is no real need for an 'INET6' conditional and, Generally speaking, -6 options should not be conditionalized out except when portability is an issue. -Matt Matthew Dillon <dillon@backplane.com>
文章代碼(AID): #11lt2l00 (DFBSD_kernel)
文章代碼(AID): #11lt2l00 (DFBSD_kernel)