From icculus at clutteredmind.org  Mon May 20 03:36:52 2002
From: icculus at clutteredmind.org (Ryan C. Gordon)
Date: Mon, 20 May 2002 03:36:52 -0400 (EDT)
Subject: stderr/stdout.
Message-ID: <Pine.LNX.4.33.0205200333280.2337-100000@gemini.verizon.net>


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"));

(Note the double parentheses.)

This way, we can still have that output in debug builds, but release
builds can #define SMPEGDBG away via the configure script.

Who's bored and wants to do this?

--ryan.




From Derrell.Lipman at UnwiredUniverse.com  Mon May 20 08:42:52 2002
From: Derrell.Lipman at UnwiredUniverse.com (Derrell.Lipman at UnwiredUniverse.com)
Date: Mon, 20 May 2002 08:42:52 -0400
Subject: [smpeg] stderr/stdout.
In-Reply-To: <Pine.LNX.4.33.0205200333280.2337-100000@gemini.verizon.net> ("Ryan
 C. Gordon"'s message of "Mon, 20 May 2002 03:36:52 -0400 (EDT)")
References: <Pine.LNX.4.33.0205200333280.2337-100000@gemini.verizon.net>
Message-ID: <znyvxa5v.fsf@random.localnet.UnwiredUniverse.com>

"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;
}


Derrell


From icculus at clutteredmind.org  Mon May 20 09:55:21 2002
From: icculus at clutteredmind.org (Ryan C. Gordon)
Date: Mon, 20 May 2002 09:55:21 -0400 (EDT)
Subject: [smpeg] stderr/stdout.
In-Reply-To: <znyvxa5v.fsf@random.localnet.UnwiredUniverse.com>
Message-ID: <Pine.LNX.4.33L2.0205200953140.26834-100000@gamehenge.icculus.org>


> 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...

Hmm...that's odd. If you can't get unsubscribed, email me off the list and
I'll remove you by hand.

> 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:

I'd like to do it that way, but I wouldn't count on that to work on all
the strange compilers smpeg is meant to be passed through, though.

--ryan.




