Hi Joe,

On Tue, Jun 25, 2013 at 12:49:31AM +1000, Joe Bloggs84 wrote:
> Hi All,
> 
> I am interested in whether there is already a way to do this and I
> am missing something or whether a change like I am proposing would
> be useful to others.
> 
> cc.h defines LWIP_PLATFORM_DIAG(x)
> as
> #define LWIP_PLATFORM_DIAG(x) printf x;
> 
> I have a situation where I have to call a function other than printf
> for any diagnostic output (to support logging).
> 
> So I had to modify cc.h and now I have to keep making the patch each
> time I jump to a new version of lwip.
> 
> What about declaring LWIP_PLATFORM_DIAG and LWIP_PLATFORM_ASSERT
> only if they are not already declared.
> 
> So something trivial like:
> #ifndef LWIP_PLATFORM_DIAG
> #define LWIP_PLATFORM_DIAG(x) printf x;
> #endif
> 
> #ifndef LWIP_PLATFORM_ASSERT
> #define LWIP_PLATFORM_ASSERT(x) do { printf("Assertion \"%s\" failed
> at line %d in %s\n", \
>                                             x, __LINE__, __FILE__);
> fflush(NULL); /* abort(); */ } while (0)
> #endif
> 
> Or is there already a way of achieving this without having to patch
> the lwip source?

Humm... cc.h is part of your lwip port which is actually not, strictly 
speaking, part of the lwip source.

Sylvain

Attachment: signature.asc
Description: Digital signature

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to