[rfc] macros and macro usage

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Sat Jun 14 19:20:08 UTC 2008


$ egrep _ARPING include/autoconf.h
#define CONFIG_ARPING 1
#define ENABLE_ARPING 1
#define USE_ARPING(...) __VA_ARGS__
#define SKIP_ARPING(...)
#define CONFIG_FEATURE_UDHCPC_ARPING 1
#define ENABLE_FEATURE_UDHCPC_ARPING 1
#define USE_FEATURE_UDHCPC_ARPING(...) __VA_ARGS__
#define SKIP_FEATURE_UDHCPC_ARPING(...)

$ egrep _MMU applets/usage.c
./applets/usage.c:#define BB_MMU 0
./applets/usage.c:#define USE_FOR_MMU(...)
./applets/usage.c:#define BB_MMU 1
./applets/usage.c:#define USE_FOR_MMU(...) __VA_ARGS__

For consistancy, I would have expected something similar to this instead:
#define USE_BB_MMU(...) __VA_ARGS__
#define SKIP_BB_MMU(...)
...

Is applets/usage.c the best place?

Shouldn't this:

	USE_FEATURE_UDHCPC_ARPING(OPTBIT_a,)

be prefered, instead of this:

#if ENABLE_FEATURE_UDHCPC_ARPING
	OPTBIT_a,
#endif

The attchment shows how networking/udhcp/dhcpc.c may be changed.


Cheers,

-- 
Cristian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dhcpc.c.patch
Type: text/x-diff
Size: 2882 bytes
Desc: 
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080614/cc66de69/attachment.bin 


More information about the busybox mailing list