/[lwip]/lwip/src/include/lwip/debug.h
ViewVC logotype

Diff of /lwip/src/include/lwip/debug.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by davidhaas, Thu Feb 6 22:18:56 2003 UTC revision 1.9 by jani, Mon Feb 10 11:15:19 2003 UTC
# Line 32  Line 32 
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
# Line 188  Line 187 
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    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26