Hi, I was trying to use #define to build several functions that all contains similar code but with different variables types and return types, etc. The following example will look useless, but I found out that it can't work because the compiler removes my whitespaces. I would like to know if it is possible to achieve something like this:
Code:
#define MAKE_FUNCTION(FUNC_NAME) bool ##FUNC_NAME##(void) {return 0;}
MAKE_FUNCTION(some_func) //Expands to "boolsome_func(void) {return 0;}" and gives error
So my problem is that the compiler deletes the space between the return type and the function's name. However, if the macro would have returned "bool*" for example, it would have compiled correctly because "bool*some_func" gets separeted with the pointer. But... Is it supposed to be possible for my "bool some_func" case?
Thanks