C
casul
Hi All,
I was told there were a few macro gurus on this group
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 since a preprocessor directive
has to be defined on its own line.
I can't seem to find any way to have line breaks in a macro expansion.
Is there a way to get a macro to expand on several lines ?
Thanks for your help.
BR,
Olivier.
I was told there were a few macro gurus on this group
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 since a preprocessor directive
has to be defined on its own line.
I can't seem to find any way to have line breaks in a macro expansion.
Is there a way to get a macro to expand on several lines ?
Thanks for your help.
BR,
Olivier.