O
olivier.grant
Hi All,
I'm trying to define a macro that will allow me to write the following
code :
#include MY_MACRO( NAME, SPACE )
and end up with the following preprocessed code :
#include NAME.hpp
namespace SPACE {
typedef NAME ImportedNAME;
}
I have a macro that generates the correct text but since macros expand
on one unique line, what I actually end up with is the following :
#include NAME.hpp namespace SPACE { typedef NAME ImportedNAME; }
The problem with this is that the preprocessor will ignore any text
behind the filename in an #include directive, so the "namespace SPACE
...." gets skipped and meerly disappears.
I've tried to defined a macro representing the carrige return
character, but it doesn't work, and I can't seem to find any other
idea. Is there a way to get a macro to expand on several lines ?
Thanks for your help.
BR,
Olivier.
I'm trying to define a macro that will allow me to write the following
code :
#include MY_MACRO( NAME, SPACE )
and end up with the following preprocessed code :
#include NAME.hpp
namespace SPACE {
typedef NAME ImportedNAME;
}
I have a macro that generates the correct text but since macros expand
on one unique line, what I actually end up with is the following :
#include NAME.hpp namespace SPACE { typedef NAME ImportedNAME; }
The problem with this is that the preprocessor will ignore any text
behind the filename in an #include directive, so the "namespace SPACE
...." gets skipped and meerly disappears.
I've tried to defined a macro representing the carrige return
character, but it doesn't work, and I can't seem to find any other
idea. Is there a way to get a macro to expand on several lines ?
Thanks for your help.
BR,
Olivier.