#include macro-generated file name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux