void hello() { cout<<"Hello world!";}void goodbye() { cout<<"Goodbye world!";}#define scriptRegisterFunction(func) EXPORTCH void func##ChDL(void* varg) { ChInterp_t interp; ChVaList_t ap; Ch_VaStart(interp,ap,varg); func(); Ch_VaEnd(interp,ap); }#define scriptDeclareFunction(funcString,func) Ch_DeclareFunc(interp,"void "##funcString##"();",func##ChDL);scriptRegisterFunction(hello);scriptRegisterFunction(goodbye);void init() { Ch_Initialize(&interp,NULL); scriptDeclareFunction("hello",hello); scriptDeclareFunction("goodbye",goodbye);}
I would like to get it to look something like this instead, but don't know how:
void hello() { cout<<"Hello world!";}void goodbye() { cout<<"Goodbye world!";}//..whatever macros & such needed here..scriptRegister(hello);scriptRegister(goodbye);