32 |
#ifndef __LWIP_DEBUG_H__ |
#ifndef __LWIP_DEBUG_H__ |
33 |
#define __LWIP_DEBUG_H__ |
#define __LWIP_DEBUG_H__ |
34 |
|
|
|
#include <stdlib.h> |
|
|
|
|
35 |
#include "lwipopts.h" |
#include "lwipopts.h" |
36 |
|
|
37 |
#ifdef LWIP_DEBUG |
#ifdef LWIP_DEBUG |
38 |
|
|
39 |
#define LWIP_ASSERT(x,y) if(!(y)) {printf("Assertion \"%s\" failed at line %d in %s\n", \ |
#define LWIP_ASSERT(x,y) do { if(!(y)) LWIP_PLATFORM_ASSERT(x) } while(0) |
40 |
x, __LINE__, __FILE__); fflush(NULL); abort();} |
#define DEBUGF(debug, x) do { if(debug) LWIP_PLATFORM_DIAG(x) } while(0) |
41 |
|
#define LWIP_ERROR(x) do { LWIP_PLATFORM_DIAG(x) } while(0) |
42 |
|
|
43 |
/* These defines control the amount of debugging output: */ |
/* These defines control the amount of debugging output: */ |
44 |
#define MEM_TRACKING |
#define MEM_TRACKING |
187 |
#define DHCP_DEBUG 0 |
#define DHCP_DEBUG 0 |
188 |
#endif |
#endif |
189 |
|
|
|
#include <stdio.h> |
|
|
#define DEBUGF(debug, x) do { if(debug){ printf x; } } while(0) |
|
190 |
|
|
191 |
|
|
192 |
#else /* LWIP_DEBUG */ |
#else /* LWIP_DEBUG */ |
193 |
|
|
194 |
/* 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 */ |
195 |
|
|
196 |
#define LWIP_ASSERT(x,y) |
#define LWIP_ASSERT(x,y) |
197 |
#define DEBUGF(debug, x) |
#define DEBUGF(debug, x) |
198 |
|
#define LWIP_ERROR(x) |
199 |
|
|
200 |
/* And we define those to be zero: */ |
/* And we define those to be zero: */ |
201 |
|
|