Re: how could I write this cpp macro



Bilgehan.Balban@xxxxxxxxx writes:

I'm trying to convert this:

printf("format str %s, %s", "str arg 1", "str arg 2 etc.");

to this:

printf("%s: " "format str %s, %s", __FUNCTION__, "str arg 1", "str arg2
etc.");

It's ghastly, but
#define pdebug printf("%s:", __FUNCTION__), printf
might do what you want.

There are probably C99-specific solutions, and definitely
GCC-specific solutions, as well.
--
Just another C hacker.
.