Re: query about use of IFDEFS

Robert Love (rml@tech9.net)
02 Nov 2001 16:30:18 -0500


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/