checks.h

来自「hello everybody. good lucky to you」· C头文件 代码 · 共 47 行

H
47
字号
/*------------------------------------------------------------------------*/
/*                                                                        */
/*  CHECKS.H                                                              */
/*                                                                        */
/*  Copyright Borland International 1991                                  */
/*  All Rights Reserved                                                   */
/*                                                                        */
/*------------------------------------------------------------------------*/

#if !defined( __CHECKS_H )
#define __CHECKS_H

#if !defined( ___DEFS_H )
#include <_defs.h>
#endif  // ___DEFS_H

extern "C" void _Cdecl __assertfail( char _FAR *__msg,
                                     char _FAR *__cond,
                                     char _FAR *__file,
                                     int __line);

#if !defined( __DEBUG )
#define __DEBUG 2
#endif

#undef PRECONDITION

#if __DEBUG < 1
#define PRECONDITION(p)   ((void)0)
#else
#define PRECONDITION(p)   ((p) ? (void)0 : (void) __assertfail(      \
                    "Precondition violated: %s, file %s, line %d\n", \
                    #p, __FILE__, __LINE__ ) )
#endif

#undef CHECK

#if __DEBUG < 2
#define CHECK(p)    ((void)0)
#else
#define CHECK(p)    ((p) ? (void)0 : (void) __assertfail(   \
                    "Check failed: %s, file %s, line %d\n", \
                    #p, __FILE__, __LINE__ ) )
#endif

#endif  // __CHECKS_H

⌨️ 快捷键说明

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