Re: [PATCH] 2.5.21 - list.h cleanup

Rusty Russell (rusty@rustcorp.com.au)
Wed, 12 Jun 2002 11:10:38 +1000


In message <3D060EC8.321A0D66@mvista.com> you write:
> On wonders if it might be useful to split header files into
> say for example, list_d.h and list_i.h with the declarations
> in the "_d.h" and inlines in the "_i.h". Then we could move
> the "_i.h" includes to the end of the include list. Yeah, I
> know, too many includes in includes to work.

The only really sane way to implement "CONFIG_SMALL_NO_INLINES" that I
can think of is to have headers do

#include <linux/inline.h>

inline_me int function(int x) { return x++; }

Then inline.h contain:

#include <linux/config.h>
#ifdef CONFIG_SMALL_NO_INLINES
#define inline_me
#else
#define inline_me static inline
#endif

And if do a final compile of a file "inlines.c" like so if
CONFIG_SMALL_NO_INLINES is set:

#include <linux/config.h>
#undef CONFIG_SMALL_NO_INLINES

/* Instantiate one of each inline for real: auto-generated list */

#include <linux/header1.h>
#include <linux/header2.h>
#include <linux/header3.h>
#include <linux/header4.h>

Expect an implementation in... um... well, someone else perhaps?
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
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/