[smpeg] stderr/stdout.

Derrell.Lipman at UnwiredUniverse.com Derrell.Lipman at UnwiredUniverse.com
Mon May 20 08:42:52 EDT 2002

"Ryan C. Gordon" <icculus at clutteredmind.org> writes:

> If anyone is really bored, I'd like to start off SMPEG development in a
> small way. Find all the printf() and fprintf(std[err/out]) calls and
> change them into a macro:
>  #define SMPEGDBG(x)  printf x
>   printf("This was printed out");
>     becomes:
>   SMPEGDBG(("This was printed out"));

I'm not subscribed to the smpeg list any more (for many months), so I'm not
quite sure why I got this message.  However...

It is no longer necessary to double-parenthesize macros with a variable number
of parameters.  Macros can accept a variable length argument list.  Define
SMPEGDBG as follows and then you can just replace printf with SMPEGDBG:

#define SMPEGDBG(x...)  printf(x)

int main(int argc, char * argv[])
  SMPEGDBG("Hello world.  Look ma, no arguments!\n");
  SMPEGDBG("This is a usage with one (%d) argument.\n", 1);
  return 0;


More information about the smpeg mailing list