mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 03:16:18 +00:00
make debugs and asserts platform independent.No more use of abort and printf.delete 2 references to arch/cpu.h and arch/lib.h
This commit is contained in:
parent
451926e5c3
commit
c13e08a7f5
@ -40,7 +40,6 @@
|
||||
#define BIG_ENDIAN 4321
|
||||
#endif
|
||||
|
||||
#include "arch/cpu.h"
|
||||
#include "arch/cc.h"
|
||||
|
||||
#ifndef PACK_STRUCT_BEGIN
|
||||
|
@ -32,14 +32,13 @@
|
||||
#ifndef __LWIP_DEBUG_H__
|
||||
#define __LWIP_DEBUG_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "lwipopts.h"
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
|
||||
#define LWIP_ASSERT(x,y) if(!(y)) {printf("Assertion \"%s\" failed at line %d in %s\n", \
|
||||
x, __LINE__, __FILE__); fflush(NULL); abort();}
|
||||
#define LWIP_ASSERT(x,y) do { if(!(y)) LWIP_PLATFORM_ASSERT(x) } while(0)
|
||||
#define DEBUGF(debug, x) do { if(debug) LWIP_PLATFORM_DIAG(x) } while(0)
|
||||
#define LWIP_ERROR(x) do { LWIP_PLATFORM_DIAG(x) } while(0)
|
||||
|
||||
/* These defines control the amount of debugging output: */
|
||||
#define MEM_TRACKING
|
||||
@ -188,16 +187,15 @@
|
||||
#define DHCP_DEBUG 0
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#define DEBUGF(debug, x) do { if(debug){ printf x; } } while(0)
|
||||
|
||||
|
||||
#else /* LWIP_DEBUG */
|
||||
|
||||
/* DEBUG is not defined, so we define null macros for LWIP_ASSERT and DEBUGF */
|
||||
/* DEBUG is not defined, so we define null macros for LWIP_ASSERT , DEBUGF and LWIP_ERROR */
|
||||
|
||||
#define LWIP_ASSERT(x,y)
|
||||
#define DEBUGF(debug, x)
|
||||
#define LWIP_ERROR(x)
|
||||
|
||||
/* And we define those to be zero: */
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
|
||||
#include "arch/lib.h"
|
||||
|
||||
#endif /* __LWIP_DEF_H__ */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user