Re: asm-offsets.h is generated in the source tree

From: Kyle Moffett
Date: Tue Sep 13 2005 - 01:49:43 EST


On Mon, Sep 12, 2005 at 09:15:25PM +0200, Sam Ravnborg wrote:
o Use some magic define trick like:
- #include "ARCHDIR##foo.h"
- I cannot recall correct syntax but something like this is doable

The syntax for that is one of the following:

# define STR(x) #x
# define XSTR(x) STR(x)

# define SOME_ARCH_DIR foo/bar
# define STRING_INCLUDE(path) XSTR(SOME_ARCH_DIR/path)
# define ANGLE_INCLUDE(path) <SOME_ARCH_DIR/path>

Then:
# include STRING_INCLUDE(baz.h) ==> # include "foo/bar/baz.h"
# include ANGLE_INCLUDE(baz.h) ==> # include <foo/bar/baz.h>

I'm not sure what GCC version these were first supported in, but I
would try to stay away from them as a matter of principle. They're
ugly and quite hard to read/understand. If there were no other way,
I might use those, but since there probably is... I dunno about
you, but those are some really icky constructions.

Cheers,
Kyle Moffett

--
Premature optimization is the root of all evil in programming
-- C.A.R. Hoare



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/