Here is what I have (message() is a specialized logging function from a third party library):
#define LOG(fmt, ...) message("%s %s(): #fmt", __FILE__, __func__, __VA_ARGS__);
So I want to be able to do things like:
LOG("Hello world")
LOG("Count = %d", count)
And have it expand to:
message("%s %s(): Hello world", __FILE__, __func__);
message("%s %s(): Count = %d", __FILE__, __func__, count);
But the #fmt thing is not working. It does not evaluate to the macro argument and prints as "#fmt". Is it possible to do what I'm trying to do?