svn commit: trunk/busybox/sysklogd
Rob Landley
rob at landley.net
Mon Aug 28 20:56:20 UTC 2006
On Monday 28 August 2006 4:24 pm, Bernhard Fischer wrote:
> >+#ifdef CONFIG_FEATURE_ROTATE_LOGFILE
> > if (ENABLE_FEATURE_ROTATE_LOGFILE && logFileSize > 0 ) {
>
> Wasn't it exactly you who did want to get rid of preprocessor use?!
Yes, very much sol. But right now, it doesn't build and the file needs a much
bigger crapectomy to clean it up properly than I have time for right now.
> So why are you adding back in preprocessor stuff in elleged trivial cases
like
> this?
Because the tree is broken otherwise?
> I admit that USE_ is broken for the next couple of years, since it is
> not yet as wide supported as you may want, but it should be possible to
> deal with this case in a somewhat sane manner even for compilers that
> do not currently support varargs in the preprocessor..
The problem is statics that are conditionally defined. Static functions can
be removed by --gc-sections but we can't rely on that yet. Static variables
can be clumped into structures and put in a gigantic union and then the ones
we only conditionally use moved to the end of the structure but always
defined. (It's not perfect, but it's an improvement.)
Unfortunately, to make that work requires some build magic I haven't come up
with a sufficiently non-ugly version for yet. (I'd like to have the struct
and the C code that uses it all in one file, but this means I have to
generate an #include file by sedding all the .c files and grabbing the
structs out of them a bit like the way xfuncs works, and I haven't had time
to sit down and come up with a version of that which isn't actually
horrendous. (Plus it involves touching the build system.)
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list