⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myassert.h

📁 路由器协议平台mpls协议的设计与实现源代码。
💻 H
字号:
/* @(#) pSOSystem PowerPC/V2.2.2: r010/include/myassert.h (&U&) 2.1 99/12/08 13:36:54 */
/***********************************************************************/
/*                                                                     */
/*   MODULE:  include/myassert.h                                       */
/*   DATE:    99/12/08                                                 */
/*   PURPOSE: R010 defined assertion macros                            */
/*                                                                     */
/*---------------------------------------------------------------------*/       
/*                                                                     */       
/*           Copyright 1998 - 2005, ZhongXing Telecom LTD.             */       
/*                      ALL RIGHTS RESERVED                            */       
/*                                                                     */       
/*   Permission is hereby granted to licensees of ZhongXing Telecom    */       
/*   LTD, products to use or abstract this computer program for the    */       
/*   sole purpose of implementing a product based on ZhongXing         */       
/*   Telecom LTD.  products.   No other rights to reproduce, use,      */       
/*   or disseminate this computer program, whether in part or in       */       
/*   whole, are granted.                                               */       
/*                                                                     */       
/*   ZhongXing Telecom LTD.  makes no representation or warranties     */       
/*   with respect to the performance of this computer program, and     */       
/*   specifically disclaims any responsibility for any damages,        */       
/*   special or consequential, connected with the use of this program. */       
/*                                                                     */       
/*---------------------------------------------------------------------*/       
/*                                                                     */
/*                                                                     */
/*                                                                     */
/***********************************************************************/
#if __cplusplus
extern "C" {
#endif

/*---------------------------------------------------------------------*/
/* Don't allow this file to be included more than once.                */
/* and not include same time with assert.h                             */
/*---------------------------------------------------------------------*/
#ifndef _ASSERT_H
#define _ASSERT_H

#ifndef __MYASSERT_H 
#define __MYASSERT_H


#ifdef NDEBUG

	#define assert(expr)    if(expr)
	#define	__BREAK__		  ((void)0)

#else	/* NDEBUG */
#if 0
	#define assert(expression)    ((void)((expression) || \
	    (fprintf(stderr, "Assertion: \"%s\" failed, in file %s, line %d\n",\
	    #expression, __FILE__, __LINE__), 0)))
#else   /* 0 */
#if defined (CADUL)
/*x86 platform, single step interrupt*/
  #pragma	_builtin_(causeinterrupt)
  void causeinterrupt(unsigned char inum);
  
  #define	__BREAK__	causeinterrupt(3)
  
#elif defined (__DCC__)
/*this will cause a invalid instruction fault*/

__asm void dofault(void)
{
	.long	0xDEADDEAD
}
  #define	__BREAK__	dofault()

#endif
	#define assert(expression) ((void)((expression) || (__BREAK__, 0)))
#endif  /*0*/

#endif	/* NDEBUG */

#endif  /* __MYASSERT_H */
#endif  /* _ASSERT_H */
#if __cplusplus
}
#endif

⌨️ 快捷键说明

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