From f12e6837beb8f4b3390214b69795b653eaffc56a Mon Sep 17 00:00:00 2001 From: Fred Baksik Date: Fri, 24 Jan 2014 03:10:30 +0000 Subject: [PATCH] LWIP_PLATFORM_DIAG: check if LWIP_PLATFORM_DIAG is defined as needed. -- LWIP_STATS and LWIP_DEBUG require this macro --- src/core/stats.c | 4 ++++ src/include/lwip/debug.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/core/stats.c b/src/core/stats.c index ff97853f..68e46371 100644 --- a/src/core/stats.c +++ b/src/core/stats.c @@ -40,6 +40,10 @@ #if LWIP_STATS /* don't build if not configured for use in lwipopts.h */ +#ifndef LWIP_PLATFORM_DIAG + #error "If you want to use LWIP_STATS, LWIP_PLATFORM_DIAG needs to be defined in your arch/cc.h" +#endif + #include "lwip/def.h" #include "lwip/stats.h" #include "lwip/mem.h" diff --git a/src/include/lwip/debug.h b/src/include/lwip/debug.h index cf549ce3..fbf62912 100644 --- a/src/include/lwip/debug.h +++ b/src/include/lwip/debug.h @@ -83,6 +83,9 @@ #endif /* LWIP_ERROR */ #ifdef LWIP_DEBUG +#ifndef LWIP_PLATFORM_DIAG + #error "If you want to use LWIP_DEBUG, LWIP_PLATFORM_DIAG needs to be defined in your arch/cc.h" +#endif /** print debug message only if debug message type is enabled... * AND is of correct type AND is at least LWIP_DBG_LEVEL */