portability touch-up (and ~15k size-savings)

Rob Landley rob at landley.net
Fri May 26 15:46:04 PDT 2006


On Thursday 25 May 2006 12:26 pm, Bernhard Fischer wrote:
> As it stands, we're most likely better off to change our policy wrt
> platform.h. Forth include "platform.h" in the my-applet.c as the very
> first include in order to pull in the proper platform-specific stuff for
> your environment. Includes covered by platform.h must not be included
> anywhere else.

Could we #include platform.h as the first #include in libbb.h, have libbb.h 
the first include in busybox.h, and say that applets should #include 
busybox.h before any other #includes they do?  (I'd rather applets didn't 
have to directly include platform.h.)

And yeah, we should probably have a standard list of #includes that platform.h 
or busybox.h does and say that other applets shouldn't #include those 
directly.  (We can even grep the tree for 'em in the testsuite, since Mike 
Frysinger seems so fond of that. :)  I actually wouldn't be adverse to 
busybox.h being the _only_ include that applets need to do, but I expect that 
won't work in practice since some applets will always need weird things (like 
networking stuff).  Dunno.

(P.S.  Part of my motivation there is that using ccache is probably fastest 
with one big #include file that it can preprocess and just bang into each new 
C file as one big lump.  But it's not a tool I regularly use, so I honestly 
don't know...)

Rob
-- 
Never bet against the cheap plastic solution.


More information about the busybox mailing list