aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/compiler.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2005-05-13 10:18:21 +0000
committerMichael Brown <mcb30@etherboot.org>2005-05-13 10:18:21 +0000
commitf0d048bf9170f7b81f726f7a44079741f74b924a (patch)
tree30a43ce2193d835474f41c77ef96d64c2dd11197 /src/include/compiler.h
parent94d512b97957ee369ad15f4c0518ee0c18237ab4 (diff)
downloadipxe-f0d048bf9170f7b81f726f7a44079741f74b924a.tar.gz
Added ASSERT() macro
Diffstat (limited to 'src/include/compiler.h')
-rw-r--r--src/include/compiler.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/include/compiler.h b/src/include/compiler.h
index 7d7c59605..4912b4242 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -67,6 +67,23 @@ __asm__ ( ".equ\tDEBUG_LEVEL, " DEBUG_SYMBOL_STR );
#define DBG2 DBG_PRINT
#endif
+/*
+ * ASSERT() macros
+ *
+ */
+#define ASSERT(x)
+
+#if DEBUG_SYMBOL >= 1
+#undef ASSERT
+#define ASSERT(x) \
+ do { \
+ if ( ! (x) ) { \
+ DBG ( "ASSERT(%s) failed at %s line %d [%s]\n", #x, \
+ __FILE__, __LINE__, __FUNCTION__ ); \
+ } \
+ } while (0)
+#endif
+
#define PACKED __attribute__((packed))
#define __unused __attribute__((unused))
#define __used __attribute__((used))