uassert.h

来自「vt6528芯片交换机API函数和文档运行程序」· C头文件 代码 · 共 89 行

H
89
字号
/*
 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
 * All rights reserved.
 *
 * This software is copyrighted by and is the sole property of
 * VIA Networking Technologies, Inc. This software may only be used
 * in accordance with the corresponding license agreement. Any unauthorized
 * use, duplication, transmission, distribution, or disclosure of this
 * software is expressly forbidden.
 *
 * This software is provided by VIA Networking Technologies, Inc. "as is"
 * and any express or implied warranties, including, but not limited to, the
 * implied warranties of merchantability and fitness for a particular purpose
 * are disclaimed. In no event shall VIA Networking Technologies, Inc.
 * be liable for any direct, indirect, incidental, special, exemplary, or
 * consequential damages.
 *
 *
 * File:    uassert.h
 *
 * Purpose: Define assert macro
 *
 * Author:  Tevin Chen
 *
 * Date:    Jan 08, 2002
 *
 */


#ifndef __UASSERT_H__
#define __UASSERT_H__

#if !defined(__CCONFIG_H__)
#include "cconfig.h"
#endif
#if !defined(__UART_H__)
#include "uart.h"
#endif




/*---------------------  Export Definitions  ------------------------*/

// if not define __DEBUG, then DBG_ASSERT will be null
//
#if __DEBUG
    #define DBG_ASSERT(f)                                               \
        do {                                                            \
            if (!(f)) {                                                 \
                UART_iPrintf("ASSERT:%s@%d\n", __FILE__, __LINE__);     \
                do {} while (1);                                        \
            }                                                           \
        } while (0)
#else  // __DEBUG
    #define DBG_ASSERT(f)
#endif // __DEBUG


#if __DEBUG_PRN_PANIC
    #define DBG_PRN_PANIC(msg)  do { UART_iPrintk("PANIC:"); UART_iPrintk(msg); } while (0)
#else  // __DEBUG_PRN_PANIC
    #define DBG_PRN_PANIC(...)  FUNC_NULL()
#endif // __DEBUG_PRN_PANIC


#if __DEBUG_PRN
    #define DBG_PRN             UART_iPrintk
#else  // __DEBUG_PRN
    #define DBG_PRN(...)        FUNC_NULL()
#endif // __DEBUG_PRN

/*---------------------  Export Types  ------------------------------*/

/*---------------------  Export Macros  -----------------------------*/

/*---------------------  Export Classes  ----------------------------*/

/*---------------------  Export Variables  --------------------------*/

/*---------------------  Export Functions  --------------------------*/




#endif /* __UASSERT_H__ */


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?