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

📄 assert.h

📁 MINIX2.0操作系统源码 MINIX2.0操作系统源码
💻 H
字号:
/*
assert.h
*/
#ifndef ASSERT_H
#define ASSERT_H

#if DEBUG

#define INIT_ASSERT	static char *assert_file= __FILE__;

void bad_assertion(char *file, int line, char *what);
void bad_compare(char *file, int line, int lhs, char *what, int rhs);

#define assert(x)	(!(x) ? bad_assertion(assert_file, __LINE__, #x) \
								: (void) 0)
#define compare(a,t,b)	(!((a) t (b)) ? bad_compare(assert_file, __LINE__, \
				(a), #a " " #t " " #b, (b)) : (void) 0)
#else /* !DEBUG */

#define INIT_ASSERT	/* nothing */

#define assert(x)	(void)0
#define compare(a,t,b)	(void)0

#endif /* !DEBUG */

#endif /* ASSERT_H */

⌨️ 快捷键说明

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