Andries.Brouwer@cwi.nl writes:
> > I know full well _why_ the big function is in the header;
> > that doesn't address my point: we don't need to be putting
> > big functions in header files. That's why libraries were invented
>
> Well. I chose the most elegant solution I saw.
>
> If you see a better solution, I would like to see it.
> Note that local symbols in several files determine
> whether this function should be compiled or not.
Then the proposed solution won't work either...
Just do an xyz.h:
#ifdef NEED_BIG_UGLY_FUNC
/* Prototype, gets pulled in when called */
void big_ugly_func(int this, void *that);
#else
/* Inline definition, gets nuked */
static inline void big_ugly_func(int this, void *that) {}
#endif
while xyz.c goes into a library (*.a) with the full definition. Gets
compiled, but not linked in.
What is wrong with that?
-- Dr. Horst H. von Brand User #22616 counter.li.org Departamento de Informatica Fono: +56 32 654431 Universidad Tecnica Federico Santa Maria +56 32 654239 Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Thu Aug 07 2003 - 22:00:40 EST