mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-07 15:04:39 +08:00
More tiny code cleanups...
This commit is contained in:
parent
f12e6837be
commit
f7905582db
@ -40,13 +40,10 @@
|
|||||||
|
|
||||||
#if LWIP_STATS /* don't build if not configured for use in lwipopts.h */
|
#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/def.h"
|
||||||
#include "lwip/stats.h"
|
#include "lwip/stats.h"
|
||||||
#include "lwip/mem.h"
|
#include "lwip/mem.h"
|
||||||
|
#include "lwip/debug.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
|
#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
|
||||||
LWIP_PLATFORM_ASSERT(message); } while(0)
|
LWIP_PLATFORM_ASSERT(message); } while(0)
|
||||||
#ifndef LWIP_PLATFORM_ASSERT
|
#ifndef LWIP_PLATFORM_ASSERT
|
||||||
#error "If you want to use LWIP_ASSERT, LWIP_PLATFORM_ASSERT needs to be defined in your arch/cc.h"
|
#error "If you want to use LWIP_ASSERT, LWIP_PLATFORM_ASSERT(message) needs to be defined in your arch/cc.h"
|
||||||
#endif
|
#endif
|
||||||
#else /* LWIP_NOASSERT */
|
#else /* LWIP_NOASSERT */
|
||||||
#define LWIP_ASSERT(message, assertion)
|
#define LWIP_ASSERT(message, assertion)
|
||||||
@ -78,13 +78,21 @@
|
|||||||
|
|
||||||
/** if "expression" isn't true, then print "message" and execute "handler" expression */
|
/** if "expression" isn't true, then print "message" and execute "handler" expression */
|
||||||
#ifndef LWIP_ERROR
|
#ifndef LWIP_ERROR
|
||||||
|
#ifndef LWIP_NOASSERT
|
||||||
|
#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_ASSERT(message)
|
||||||
|
#elif defined LWIP_DEBUG
|
||||||
|
#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_DIAG(message)
|
||||||
|
#else
|
||||||
|
#define LWIP_PLATFORM_ERROR(message)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
|
#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
|
||||||
LWIP_PLATFORM_ASSERT(message); handler;}} while(0)
|
LWIP_PLATFORM_ERROR(message); handler;}} while(0)
|
||||||
#endif /* LWIP_ERROR */
|
#endif /* LWIP_ERROR */
|
||||||
|
|
||||||
#ifdef LWIP_DEBUG
|
#ifdef LWIP_DEBUG
|
||||||
#ifndef LWIP_PLATFORM_DIAG
|
#ifndef LWIP_PLATFORM_DIAG
|
||||||
#error "If you want to use LWIP_DEBUG, LWIP_PLATFORM_DIAG needs to be defined in your arch/cc.h"
|
#error "If you want to use LWIP_DEBUG, LWIP_PLATFORM_DIAG(message) needs to be defined in your arch/cc.h"
|
||||||
#endif
|
#endif
|
||||||
/** print debug message only if debug message type is enabled...
|
/** print debug message only if debug message type is enabled...
|
||||||
* AND is of correct type AND is at least LWIP_DBG_LEVEL
|
* AND is of correct type AND is at least LWIP_DBG_LEVEL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user