Re: #ifdef INET6
: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>
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):