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
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: frey waid <waid at cisco dot com>
- Cc: neil at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org,nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: Mon, 10 Feb 2003 23:02:26 +0000
- Subject: Re: preprocessor/9650: string literal contactenation doesn't work with #include
- References: <20030210225732.10027.qmail@sources.redhat.com> <3E482F5D.C1E2DF60@cisco.com>
frey waid wrote:-
> that's what i was doing before. so i had this:
>
> #include COMP_INC(comp,file)
>
> #define COMP_INC(comp,file) #comp "/include/" #file
>
> do you have another method in mind?
Sure 8-)
#include COMP_INC (comp, file)
#define COMP_INC(comp, file) COMP (comp, file)
#define COMP(prefix, suffix) str(comp/include/file)
#define str(x) #x
Not tested, but you get the idea.
Neil.