I want to include the result of a macro expansion. It seems include only knows <> “”?
This fails:
#define audio sinwave
#ifdef audio
#include audio".c"
/*#include "sinwave.c"*/
#endif
But this works:
#ifdef audio
if(i==0){set_audio((char *)audio);return;}
#endif
You could do something like this:
that is you’d have to append the
.cbefore you place everything into a string. The usual concatenation"audio" ".c" -> "audio.c"of adjacent strings happens in a later compilation phase than preprocessing, so an#includedirective cannot deal with this.