This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: stdio vs. diag_printf
- To: ecos-discuss at sources dot redhat dot com
- Subject: [ECOS] Re: stdio vs. diag_printf
- From: "Andre" <armcc at mailcity dot com>
- Date: Mon, 10 Jul 2000 19:02:31 -0700
- Organization: MailCity (http://www.mailcity.lycos.com:80)
- Reply-To: armcc at mailcity dot com
Grant Edwards wrote:
> > > I'll have to look up the gnu cpp extensions to see if there's
> > > a way to do
> > >
> > >#define define printf(vararg_list) daig_printf(vararg_list)
> >
> > You chould be able to get away with:
> >
> > #include <cyg/infra/diag.h>
> > #define printf diag_printf
>
> Doh! Of course. Got caught up looking for a complex solution to a
> simple problem.
<smartarse_mode>
The complex solution (with gnu cpp anyway) is something like:
#define printf(fmt, args...) diag_printf(fmt, ## args)
A nice variation on this is to use
#define printf(fmt, args...)
to disable all printf's without having to make each one conditional,
which can be useful.
</smartarse_mode>
Send FREE Greetings for Father's Day--or any day!
Click here: http://www.whowhere.lycos.com/redirects/fathers_day.rdct