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?

Thanks a lot,
Ian

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

Reply via email to