From: Krzysztof Halasa <khc@pm.waw.pl>
To: "Chris Friesen" <cfriesen@nortel.com>
Cc: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: including .c files ?
Date: Fri, 08 Aug 2008 17:46:44 +0200 [thread overview]
Message-ID: <m33alfjyqj.fsf@maximus.localdomain> (raw)
In-Reply-To: <489C60D3.2040201@nortel.com> (Chris Friesen's message of "Fri\, 08 Aug 2008 09\:05\:55 -0600")
"Chris Friesen" <cfriesen@nortel.com> 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
next prev parent reply other threads:[~2008-08-08 15:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 11:25 including .c files ? Frans Meulenbroeks
2008-08-08 14:30 ` Krzysztof Halasa
2008-08-08 15:05 ` Chris Friesen
2008-08-08 15:46 ` Krzysztof Halasa [this message]
2008-08-08 15:36 ` Rene Herman
2008-08-08 19:13 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m33alfjyqj.fsf@maximus.localdomain \
--to=khc@pm.waw.pl \
--cc=cfriesen@nortel.com \
--cc=fransmeulenbroeks@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox