query about use of IFDEFS

Manik Raina (manik@cisco.com)
Fri, 02 Nov 2001 19:06:19 +0530


hi,

which of the following be acceptable in the linux kernel ?

1. first choice, you've put the static inline in the header
---------------------------------------

foo.h:

#ifdef CONFIG_BAR
void foo_init(void);
#else
static void __inline__ foo_init(void);

foo.c:

#ifdef CONFIG_BAR

void foo_init(void)
{
do_some_stuff_here();
}

#else
#endif

2. you've left the conditional compilation only in the .c file
----------------------------------------

foo.h:

void foo_init(void);

foo.c:

void foo_init (void)
{

#ifdef CONFIG_BAR
do_some_stuff_here();
#else
#endif
}

-
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/