From 2b5d1dc418a323b3969eb6fc5a62335ffb51db8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 18 Jul 2002 18:45:07 +0000 Subject: [PATCH] Added the preliminary ASSERT() macro from NewOS. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@310 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/debug.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/headers/private/kernel/debug.h b/headers/private/kernel/debug.h index 38fc5ca505..5d8a6c6373 100755 --- a/headers/private/kernel/debug.h +++ b/headers/private/kernel/debug.h @@ -30,4 +30,11 @@ int remove_debugger_command(const char * name, int (*func)(int, char **)); extern void dbg_save_registers(int *); /* arch provided */ +#if DEBUG +# define ASSERT(x) \ + { if (!(x)) panic("ASSERT FAILED (%s:%d): %s", __FILE__, __LINE__, #x); } +#else +# define ASSERT(x) #endif + +#endif /* _KERNEL_DEBUG_H */