* same with xv6
[mascara-docs.git] / i386 / standford / 2004 / src / lab4 / inc / assert.h
blobb05ed466ba307672050d3b63ec429a861e552e03
1 /* See COPYRIGHT for copyright information. */
3 #ifndef _INC_ASSERT_H_
4 #define _INC_ASSERT_H_
6 #include <inc/stdio.h>
8 void _warn(const char *, int, const char *, ...);
9 void _panic(const char *, int, const char *, ...)
10 __attribute__((noreturn));
12 #define warn(...) _warn(__FILE__, __LINE__, __VA_ARGS__)
13 #define panic(...) _panic(__FILE__, __LINE__, __VA_ARGS__)
15 #define assert(x) \
16 do { if (!(x)) panic("assertion failed: %s", #x); } while (0)
18 #endif