#include macro-generated file name

John Breitenbach breiten@lexmark.com
Fri Sep 12 12:53:00 GMT 2008


Hi,
  While upgrading some code from 2.95.3 to gcc-3.4.6, I ran into a 
problem where we were construction an include filename with macros like 
this:

#ifdef AAA
DIR="dir1"
#elif defined( BBB)
DIR="dir2"
#elif defined( CCC)
DIR="dir3"

#include DIR/file1
#include DIR/file2
#include DIR/file3
...

This worked fine with 2.95.3, but I've been unable to make this work 
with 3.4.6.   In the documentation for the 2.95.3 preprocessor, there is
some verbage about a computed include, which will expand macros and 
concatenate strings.  However, this is not in the later docs.

Is this simply no longer allowed?  Adding the proper include search-path 
to the command line isn't easy.  I'm thinking that I'll just need
to replicate my block of #include directives.  But before I give up, I 
felt the need to ask.
Thanks!



More information about the Gcc-help mailing list