|
From: | Joe Bloggs84 |
Subject: | [lwip-users] redefining LWIP_PLATFORM_DIAG(x) |
Date: | Tue, 25 Jun 2013 00:49:31 +1000 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 |
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)
#endifOr is there already a way of achieving this without having to patch the lwip source?
Thanks a lot, Ian
[Prev in Thread] | Current Thread | [Next in Thread] |