[haiku-commits] r35536 - haiku/trunk/headers/private/kernel

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 20 Feb 2010 15:19:52 +0100 (CET)

Author: bonefish
Date: 2010-02-20 15:19:52 +0100 (Sat, 20 Feb 2010)
New Revision: 35536
Changeset: http://dev.haiku-os.org/changeset/35536/haiku

Modified:
   haiku/trunk/headers/private/kernel/debug.h
Log:
Changed ASSERT_[ALWAYS_]PRINT() to add the additional output to the panic()
message instead of printing it before calling panic().


Modified: haiku/trunk/headers/private/kernel/debug.h
===================================================================
--- haiku/trunk/headers/private/kernel/debug.h  2010-02-20 14:00:56 UTC (rev 
35535)
+++ haiku/trunk/headers/private/kernel/debug.h  2010-02-20 14:19:52 UTC (rev 
35536)
@@ -33,24 +33,24 @@
 #define ASSERT_ALWAYS(x) \
        do {                                                                    
                                                                \
                if (!(x)) {                                                     
                                                                \
-                       panic("ASSERT FAILED (%s:%d): %s\n", __FILE__, 
__LINE__, #x);   \
+                       panic("ASSERT FAILED (%s:%d): %s", __FILE__, __LINE__, 
#x);             \
                }                                                               
                                                                        \
        } while (0)
 
-#define ASSERT_ALWAYS_PRINT(x, format...) \
+#define ASSERT_ALWAYS_PRINT(x, format, args...) \
        do {                                                                    
                                                                \
                if (!(x)) {                                                     
                                                                \
-                       dprintf_no_syslog(format);                              
                                                \
-                       panic("ASSERT FAILED (%s:%d): %s\n", __FILE__, 
__LINE__, #x);   \
+                       panic("ASSERT FAILED (%s:%d): %s; " format, __FILE__, 
__LINE__, \
+                               #x, args);                                      
                                                                \
                }                                                               
                                                                        \
        } while (0)
 
 #if KDEBUG
-#      define ASSERT(x)                                        ASSERT_ALWAYS(x)
-#      define ASSERT_PRINT(x, format...)       ASSERT_ALWAYS_PRINT(x, format)
+#      define ASSERT(x)                                                
ASSERT_ALWAYS(x)
+#      define ASSERT_PRINT(x, format, args...) ASSERT_ALWAYS_PRINT(x, format, 
args)
 #else
-#      define ASSERT(x)                                        do { } while(0)
-#      define ASSERT_PRINT(x, format...)       do { } while(0)
+#      define ASSERT(x)                                                do { } 
while(0)
+#      define ASSERT_PRINT(x, format, args...) do { } while(0)
 #endif
 
 #if KDEBUG


Other related posts:

  • » [haiku-commits] r35536 - haiku/trunk/headers/private/kernel - ingo_weinhold