lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re: LWIP_PLATFORM_DIAG


From: Jonathan Larmour
Subject: [lwip-users] Re: LWIP_PLATFORM_DIAG
Date: Wed, 09 Jan 2008 14:22:42 +0000
User-agent: Thunderbird 1.5.0.12 (X11/20070530)

[ I changed the Subject - please remember to make a new message ]

Jan Wester wrote:
> Is where any example availble for defined of macros for lwip_platform_diag
> printout

Yes, lots in the "contrib" part of lwIP. The usual definition is:

#define LWIP_PLATFORM_DIAG(x)       do {printf x;} while(0)

> I have try def for lwip_platform_diag but it is problem to get it work and I
> found out it is problem with variable no of arguments, it works for one
> argument (only print format string)
> if the arguments consists of format string and a integer, the input
> parameter for the function is a value of the integer, should be a pointer ?

Are you calling it yourself? All the instances that lwIP itself makes use
double brackets. Perhaps these have been forgotten.

So you can do something like:
LWIP_PLATFORM_DIAG(("foo=%d\n", foo));
which will expand to:

do {printf (foo=%d\n", foo);} while(0)
and it all works.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine




reply via email to

[Prev in Thread] Current Thread [Next in Thread]