调试之断言宏

LWIP_ERROR("tcp_connect: can only connect from state CLOSED", pcb->state == CLOSED, return ERR_ISCONN);

#ifndef LWIP_PLATFORM_ASSERT
  #define LWIP_PLATFORM_ASSERT(x) do { if(!(x)) while(1); } while(0)
#endif

#ifndef LWIP_NOASSERT
#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
  LWIP_PLATFORM_ASSERT(message); } while(0)

#ifndef LWIP_ERROR  //开关宏
#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \

  LWIP_PLATFORM_ASSERT(message);\

  handler;}} while(0)
#endif /* LWIP_ERROR */

 

posted on 2018-06-30 13:00  杰瑞鼠  阅读(539)  评论(0编辑  收藏  举报