assert.h
来自「jos lab3代码」· C头文件 代码 · 共 21 行
H
21 行
/* See COPYRIGHT for copyright information. */#ifndef JOS_INC_ASSERT_H#define JOS_INC_ASSERT_H#include <inc/stdio.h>void _warn(const char*, int, const char*, ...);void _panic(const char*, int, const char*, ...) __attribute__((noreturn));#define warn(...) _warn(__FILE__, __LINE__, __VA_ARGS__)#define panic(...) _panic(__FILE__, __LINE__, __VA_ARGS__)#define assert(x) \ do { if (!(x)) panic("assertion failed: %s", #x); } while (0)// static_assert(x) will generate a compile-time error if 'x' is false.#define static_assert(x) switch (x) case 0: case (x):#endif /* !JOS_INC_ASSERT_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?