I have the following define:
#define MY_CLASS MyClass
I'm trying to make a macro that will use MY_CLASS to expand to:
#include "MyClass.h"
Something like (according to this answer):
#define MY_CLASS MyClass
#define FILE_EXT h
#define M_CONC(A, B) M_CONC_(A, B)
#define M_CONC_(A, B) A##B
#define APP_BUILD M_CONC(MY_CLASS, M_CONC(.,FILE_EXT))
#include APP_BUILD
That one doesn't work though... I get these 3 errors:
Expected "FILENAME" or <FILENAME>
Pasting formed '.h', an invalid preprocessing token
Pasting formed 'MyClass.', an invalid preprocessing token
Is it possible to do it somehow?