I have some code that is to compile on two different compilers.
Each compiler has a different syntax for a required #pragma
statement (OT, but the pragma's purpose is to identify the
TU's data so the linker can put it where I want it).
Currently I am writing:
#if (defined FOO_COMPILER)
# pragma FOO
#elif (defined BAR_COMPILER)
# pragma BAR
#endif
in every .c file. This would be even worse if there were more
compilers to support. I would prefer to have just one line in
every .c file, eg:
#pragma THE_PRAGMA
and in a header file:
#if (defined FOO_COMPILER)
# define THE_PRAGMA FOO
#elif (defined BAR_COMPILER)
# define THE_PRAGMA BAR
#endif
but that syntax isn't accepted. Is there some way of doing
what I want?