Re: query about use of IFDEFS

From: Robert Love (rml@tech9.net)
Date: Fri Nov 02 2001 - 16:30:18 EST


On Fri, 2001-11-02 at 08:36, Manik Raina wrote:
> which of the following be acceptable in the linux kernel ?
> [...]

The first. You want the code itself to be clean and clear; free of
ifdefs.

So in your header files you ifdef as needed. The simplest example of
this would be with a define:

        #ifdef CONFIG_SMP
        #define special_smp_thing() whatever_smp()
        #else
        #define special_smp_thing()
        #endif

        Robert Love

-
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 : Wed Nov 07 2001 - 21:00:20 EST