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

📄 assert.h

📁 一个简单的操作系统minix的核心代码
💻 H
字号:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
				src/kernel/assert.h	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

05500	/*
05501	assert.h
05502	*/
05503	#ifndef ASSERT_H
05504	#define ASSERT_H
05505	
05506	#if DEBUG
05507	
05508	#define INIT_ASSERT     static char *assert_file= __FILE__;
05509	
05510	void bad_assertion(char *file, int line, char *what);
05511	void bad_compare(char *file, int line, int lhs, char *what, int rhs);
05512	
05513	#define assert(x)       (!(x) ? bad_assertion(assert_file, __LINE__, #x) \
05514	                                                                : (void) 0)
05515	#define compare(a,t,b)  (!((a) t (b)) ? bad_compare(assert_file, __LINE__, \
05516	                                (a), #a " " #t " " #b, (b)) : (void) 0)
05517	#else /* !DEBUG */
05518	
05519	#define INIT_ASSERT     /* nothing */
05520	
05521	#define assert(x)       (void)0
05522	#define compare(a,t,b)  (void)0
05523	
05524	#endif /* !DEBUG */
05525	
05526	#endif /* ASSERT_H */

⌨️ 快捷键说明

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