Re: including .c files ?

From: Krzysztof Halasa
Date: Fri Aug 08 2008 - 11:46:58 EST


"Chris Friesen" <cfriesen@xxxxxxxxxx> writes:

>> Doesn't work when you need conditional compilation.
>
> Sure it does...look at all the kernel Makefiles that compile code
> based on whether a config option is set.

Nope, I meant compilation depending on preprocessor variables defined
(or not) by the including file. CONFIG_* and things like make
variables are completely different things.

Imagine a chip driver (library) doing I/O using either MMIO or
inp/outp. The real card driver uses the library and provides
necessary glue code. You can either a) make I/O real function calls,
call using pointers etc. (slow, should be inline), or b) define the
I/O as inline functions or macros and then #include the library.
--
Krzysztof Halasa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/