I’m generating some compile-time code. I need to append a suffix to a generated function name, based on a macro boolean. The suffix is either present or empty. How to do that?
#define FUNC_NAME(name, hasSuffix) name ## MAYBE_SHOW_SUFFIX(hasSuffix)
FUNC_NAME(foo, true); // would generate: foo_
FUNC_NAME(foo, false); // would generate: foo
You need to sign in to view this answers