J
Joakim Hove
Hello,
I would like to construct a macro, which does conditional include of
another source file. i.e. something like this:
#MPIinclude(FileName) (#include (FileName)) /* Alternative one -
actually includes MPI source */
#MPIinclude(FileName) /* Alternative two -
a noop */
So that the body of the code can contain:
MPIinclude("path/to/mpi_code/mpi_file.c")
However, when preprosessing the macro definition above I get the
following error message (from gnu cpp):
fphs.c:20:32: '#' is not followed by a macro parameter
and the resulting code later fails in the eventual compilation.
Is this possible?
Joakim
I would like to construct a macro, which does conditional include of
another source file. i.e. something like this:
#MPIinclude(FileName) (#include (FileName)) /* Alternative one -
actually includes MPI source */
#MPIinclude(FileName) /* Alternative two -
a noop */
So that the body of the code can contain:
MPIinclude("path/to/mpi_code/mpi_file.c")
However, when preprosessing the macro definition above I get the
following error message (from gnu cpp):
fphs.c:20:32: '#' is not followed by a macro parameter
and the resulting code later fails in the eventual compilation.
Is this possible?
Joakim