Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754655AbYHHPq4 (ORCPT ); Fri, 8 Aug 2008 11:46:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752514AbYHHPqs (ORCPT ); Fri, 8 Aug 2008 11:46:48 -0400 Received: from khc.piap.pl ([195.187.100.11]:44745 "EHLO khc.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751720AbYHHPqr (ORCPT ); Fri, 8 Aug 2008 11:46:47 -0400 To: "Chris Friesen" Cc: Frans Meulenbroeks , linux-kernel@vger.kernel.org Subject: Re: including .c files ? References: <489C60D3.2040201@nortel.com> From: Krzysztof Halasa Date: Fri, 08 Aug 2008 17:46:44 +0200 In-Reply-To: <489C60D3.2040201@nortel.com> (Chris Friesen's message of "Fri\, 08 Aug 2008 09\:05\:55 -0600") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 984 Lines: 23 "Chris Friesen" 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/