X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fkdebug.h;h=fe67c8ed20d930d532acf66bb6d1d5b86fc66ba2;hb=4afd09ec0c80aa1611fc3b5a3517e9c0d1755cfd;hp=1fe13211814595918568d1c7626f243d616bf0d0;hpb=7ee3b3c3da60b181d18336e892d8d0920166f5ae;p=bertos.git diff --git a/drv/kdebug.h b/drv/kdebug.h index 1fe13211..fe67c8ed 100755 --- a/drv/kdebug.h +++ b/drv/kdebug.h @@ -3,7 +3,7 @@ * * * \brief Definition of handy debug macros. These macros are no-ops @@ -16,6 +16,13 @@ /* * $Log$ + * Revision 1.4 2004/07/30 14:26:33 rasky + * Semplificato l'output dell'ASSERT + * Aggiunta ASSERT2 con stringa di help opzionalmente disattivabile + * + * Revision 1.3 2004/06/03 11:27:09 bernie + * Add dual-license information. + * * Revision 1.2 2004/05/23 18:21:53 bernie * Trim CVS logs and cleanup header info. * @@ -60,7 +67,14 @@ int __check_wall(long *wall, int size, const char *name, const char *file, int line); #define THIS_FILE __FILE__ - #define ASSERT(x) ((x) ? 0 : __assert(#x, THIS_FILE, __LINE__)) + #ifndef CONFIG_KDEBUG_ASSERT_NO_TEXT + #define ASSERT(x) ((x) ? 0 : __assert(#x, THIS_FILE, __LINE__)) + #define ASSERT2(x, help) ((x) ? 0 : __assert(help " (" #x ")", THIS_FILE, __LINE__)) + #else + #define ASSERT(x) ((x) ? 0 : __assert("", THIS_FILE, __LINE__)) + #define ASSERT2(x, help) ASSERT(x) + #endif + #define ASSERT_VALID_PTR(p) ((p >= 0x200) ? 0 : __invalid_ptr(p, #p, THIS_FILE, __LINE__)) #define ASSERT_VALID_PTR_OR_NULL(p) (((p == NULL) || (p >= 0x200)) ? 0 : __invalid_ptr(p, #p, THIS_FILE, __LINE__)) #define TRACE kprintf("%s()\n", __FUNCTION__) @@ -77,6 +91,7 @@ #else /* !_DEBUG */ #define ASSERT(x) + #define ASSERT2(x, help) #define ASSERT_VALID_PTR(p) #define ASSERT_VALID_PTR_OR_NULL(p) #define TRACE do {} while(0) @@ -87,6 +102,9 @@ #define INIT_WALL(name) #define CHECK_WALL(name) + INLINE void kdbg_init(void) {} + INLINE void kprintf(UNUSED(const char*, fmt), ...) {} + #endif /* !_DEBUG */ #endif /* KDEBUG_H */