xassert.h

来自「伯克利做的SFTP安全文件传输协议」· C头文件 代码 · 共 29 行

H
29
字号
// xassert.h// replacement for assert that throws an exception on failure// (x_assert_fail and xfailure_func are in exc.cc)// SafeTP project// copyright SafeTP Development Group, Inc., 2000  Terms of use are as specified in license.txt#ifndef __XASSERT_H#define __XASSERT_Hvoid x_assert_fail(char const *cond, char const *file, int line);#if !defined(NDEBUG) || defined(NDEBUG_ASSERTIONS)  #define xassert(cond) \    ((cond)? (void)0 : x_assert_fail(#cond, __FILE__, __LINE__))#else  #define xassert(cond) ((void)0)#endif// call when state is known to be bad; will *not* return (ideal// behavior is to throw an exception, systems lacking this can// call abort())#define xfailure(why) x_assert_fail(why, __FILE__, __LINE__)#endif // __XASSERT_H

⌨️ 快捷键说明

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