This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor/9650: string literal contactenation doesn't work with #include
frey waid wrote:-
> i tried that but it doesn't work consistently with the newer prescan semantics.
> for example, if i did this:
Prescan semantics haven't changed. Apart from removal of the odd
segfault ;-)
> #include COMP_INC(me, mips/hello.h)
>
> you'd think it'd expand with the below method:
>
> #include "me/include/mips/hello.h"
>
> unfortunately, mips is a predefined macro. so it expands to "1". is there a
> work around for this without having to undefine it?
No, that's the way C works, because mips is lexed as a token in its own
right. You need to use a different path, or #undef mips. Or, latest
versions of GCC won't invade your namespace like this with -ansi. Prior
versions of GCC were somewhat unpredictable.
Neil.