query about use of IFDEFS

From: Manik Raina (manik@cisco.com)
Date: Fri Nov 02 2001 - 08:36:19 EST


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/



This archive was generated by hypermail 2b29 : Wed Nov 07 2001 - 21:00:18 EST