diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-02-13 19:16:41 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-02-13 19:16:41 +0000 |
commit | f9a421a6e804a9b2367765737ddb5838c94de9a8 (patch) | |
tree | 5995ddbb62eeda3512fa408b78bbd1eb8832ae4a /include/platform.h | |
parent | c1422979ad28708e803c39674eb3e162e42875ca (diff) | |
download | busybox-w32-f9a421a6e804a9b2367765737ddb5838c94de9a8.tar.gz busybox-w32-f9a421a6e804a9b2367765737ddb5838c94de9a8.tar.bz2 busybox-w32-f9a421a6e804a9b2367765737ddb5838c94de9a8.zip |
New USE() macros
For each CONFIG_SYMBOL, include/bb_config.h now has both ENABLE_SYMBOL
and USE_SYMBOL(x). ENABLE_SYMBOL is still always defined (1 or 0) so that
if(ENABLE) should optimize out when it's zero. The USE_SYMBOL(X) will only
splice in X if the symbol is defined, otherwise it'll be empty.
Thus we can convert this:
#ifdef CONFIG_ARGS
opt = bb_getopt_ulflags(argc, argv, "ab:c"
#ifdef CONFIG_THINGY
"d:"
#endif
, &bvalue
#ifdef CONFIG_THINGY
, &thingy
#endif
);
#endif
into this:
if (ENABLE_ARGS) {
opt = bb_getopt_ulflags(argc, argv, "ab:c" USE_THINGY("d:"), &bvalue
USE_THINGY(, &thingy));
}
And it should produce the same code.
Unlike the old versions in include/_usage.h, the new USE_SYMBOL(x) can handle
commas in its arguments (as shown above). (The _usage.h file is obsolete and
no longer generated.)
Nobody should need to include config.h directly anymore, bb_config.h should
define all the configuration stuff we need. Someday, the CONFIG_SYMBOL
versions should go away in favor of ENABLE_SYMBOL and USE_SYMBOL().
Thanks to vodz for the new version of bb_mkdep.c that works with function
macros.
git-svn-id: svn://busybox.net/trunk/busybox@13955 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'include/platform.h')
-rw-r--r-- | include/platform.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/include/platform.h b/include/platform.h index 773d6b8b2..68c7abbc6 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -78,9 +78,4 @@ | |||
78 | # endif | 78 | # endif |
79 | #endif | 79 | #endif |
80 | 80 | ||
81 | |||
82 | /* include USAGE_APPLET_x helper macros for usage.h. */ | ||
83 | /* | ||
84 | #include "_usage.h" | ||
85 | */ | ||
86 | #endif /* platform.h */ | 81 | #endif /* platform.h */ |