Changed ASSERT_[ALWAYS_]PRINT() to add the additional output to the panic()

message instead of printing it before calling panic().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35536 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-02-20 14:19:52 +00:00
parent 9e4ad0799b
commit 8b522fcfe6

View File

@ -33,24 +33,24 @@
#define ASSERT_ALWAYS(x) \ #define ASSERT_ALWAYS(x) \
do { \ do { \
if (!(x)) { \ if (!(x)) { \
panic("ASSERT FAILED (%s:%d): %s\n", __FILE__, __LINE__, #x); \ panic("ASSERT FAILED (%s:%d): %s", __FILE__, __LINE__, #x); \
} \ } \
} while (0) } while (0)
#define ASSERT_ALWAYS_PRINT(x, format...) \ #define ASSERT_ALWAYS_PRINT(x, format, args...) \
do { \ do { \
if (!(x)) { \ if (!(x)) { \
dprintf_no_syslog(format); \ panic("ASSERT FAILED (%s:%d): %s; " format, __FILE__, __LINE__, \
panic("ASSERT FAILED (%s:%d): %s\n", __FILE__, __LINE__, #x); \ #x, args); \
} \ } \
} while (0) } while (0)
#if KDEBUG #if KDEBUG
# define ASSERT(x) ASSERT_ALWAYS(x) # define ASSERT(x) ASSERT_ALWAYS(x)
# define ASSERT_PRINT(x, format...) ASSERT_ALWAYS_PRINT(x, format) # define ASSERT_PRINT(x, format, args...) ASSERT_ALWAYS_PRINT(x, format, args)
#else #else
# define ASSERT(x) do { } while(0) # define ASSERT(x) do { } while(0)
# define ASSERT_PRINT(x, format...) do { } while(0) # define ASSERT_PRINT(x, format, args...) do { } while(0)
#endif #endif
#if KDEBUG #if KDEBUG