summaryrefslogtreecommitdiff
path: root/nuttx/include/assert.h
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/include/assert.h')
-rw-r--r--nuttx/include/assert.h40
1 files changed, 24 insertions, 16 deletions
diff --git a/nuttx/include/assert.h b/nuttx/include/assert.h
index 2159ea868..8934d4d55 100644
--- a/nuttx/include/assert.h
+++ b/nuttx/include/assert.h
@@ -63,43 +63,51 @@
# define VERIFY(f) \
{ if ((f) < 0) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
+# define PANIC() \
+ up_assert((const uint8_t *)__FILE__, (int)__LINE__)
+
# ifdef CONFIG_DEBUG
+
# define DEBUGASSERT(f) \
{ if (!(f)) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
+
# define DEBUGVERIFY(f) \
{ if ((f) < 0) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
+
+# define DEBUGPANIC() \
+ up_assert((const uint8_t *)__FILE__, (int)__LINE__)
+
# else
+
# define DEBUGASSERT(f)
# define DEBUGVERIFY(f) ((void)(f))
-# endif /* CONFIG_DEBUG */
+# define DEBUGPANIC()
-# define PANIC() \
- up_assert((const uint8_t *)__FILE__, (int)__LINE__)
+# endif /* CONFIG_DEBUG */
#else
-# define ASSERT(f) \
- { if (!(f)) up_assert(); }
-# define VERIFY(f) \
- { if ((f) < 0) up_assert(); }
+# define ASSERT(f) { if (!(f)) up_assert(); }
+# define VERIFY(f) { if ((f) < 0) up_assert(); }
+# define PANIC() up_assert()
# ifdef CONFIG_DEBUG
-# define DEBUGASSERT(f) \
- { if (!(f)) up_assert(); }
-# define DEBUGVERIFY(f) \
- { if ((f) < 0) up_assert(); }
+
+# define DEBUGASSERT(f) { if (!(f)) up_assert(); }
+# define DEBUGVERIFY(f) { if ((f) < 0) up_assert(); }
+# define DEBUGPANIC() up_assert()
+
# else
+
# define DEBUGASSERT(f)
# define DEBUGVERIFY(f) ((void)(f))
-# endif /* CONFIG_DEBUG */
-
-# define PANIC(code) \
- up_assert()
+# define DEBUGPANIC()
+# endif /* CONFIG_DEBUG */
#endif
#ifndef assert
-#define assert ASSERT
+# define assert ASSERT
#endif
/****************************************************************************