[rfc] macros and macro usage

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Sun Jun 15 08:56:13 UTC 2008


On Sun, 15 Jun 2008, Denys Vlasenko wrote:

> On Saturday 14 June 2008 21:20, Cristian Ionescu-Idbohrn wrote:
> > Shouldn't this:
> >
> > 	USE_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
> >
> > be prefered, instead of this:
> >
> > #if ENABLE_FEATURE_UDHCPC_ARPING
> > 	OPTBIT_a,
> > #endif
>
> Yes, generally, if USE_xxx(foo) doesn't stretch across more than one line.
> That looks worse (less readable) than ifdef.
>
> > The attchment shows how networking/udhcp/dhcpc.c may be changed.
>
> Applied, thanks!

Great.  And now there are just a gazillion other places that need similar
adjustments ;)  But before starting with that I feel it's important to
make some preparations and agree on the general principles.

It was the paragraph "No ifdefs in .c Code" in this article:

  http://www.linuxjournal.com/article/5780

Natanael Copa pointed to the other day that got me started ;)


Cheers,

-- 
Cristian



More information about the busybox mailing list