From af6b12cc76b40c86f3b144a7f5cd3ef1278863d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 7 Feb 2008 01:07:49 +0900 Subject: [PATCH] gallium: Bring latest fixes. --- src/mesa/pipe/p_debug.h | 9 ++++++++- src/mesa/pipe/util/p_debug.c | 16 +++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/mesa/pipe/p_debug.h b/src/mesa/pipe/p_debug.h index b037eba..2a11627 100644 --- a/src/mesa/pipe/p_debug.h +++ b/src/mesa/pipe/p_debug.h @@ -38,6 +38,10 @@ #ifndef P_DEBUG_H_ #define P_DEBUG_H_ + +#include + + #ifdef __cplusplus extern "C" { #endif @@ -55,8 +59,12 @@ extern "C" { void debug_printf(const char *format, ...); + +void debug_vprintf(const char *format, va_list ap); + void debug_assert_fail(const char *expr, const char *file, unsigned line); + /** Assert macro */ #ifdef DEBUG #define debug_assert(expr) ((expr) ? (void)0 : debug_assert_fail(#expr, __FILE__, __LINE__)) @@ -66,7 +74,6 @@ void debug_assert_fail(const char *expr, const char *file, unsigned line); #ifdef assert -#warning Standard C Library assert macro usage detected. #undef assert #endif #define assert(expr) debug_assert(expr) diff --git a/src/mesa/pipe/util/p_debug.c b/src/mesa/pipe/util/p_debug.c index 9303c97..b9607a6 100644 --- a/src/mesa/pipe/util/p_debug.c +++ b/src/mesa/pipe/util/p_debug.c @@ -40,16 +40,22 @@ #include "pipe/p_compiler.h" -void debug_printf(const char *format, ...) +void debug_vprintf(const char *format, va_list ap) { - va_list ap; - va_start( ap, format ); #ifdef WIN32 EngDebugPrint("Gallium3D: ", (PCHAR)format, ap); #else vfprintf(stderr, format, ap); #endif - va_end( ap ); +} + + +void debug_printf(const char *format, ...) +{ + va_list ap; + va_start(ap, format); + debug_vprintf(format, ap); + va_end(ap); } @@ -65,6 +71,6 @@ static INLINE void debug_abort(void) void debug_assert_fail(const char *expr, const char *file, unsigned line) { - debug_printf("%s:%i: Assertion `%s' failed."); + debug_printf("%s:%i: Assertion `%s' failed.\n", file, line, expr); debug_abort(); } -- 2.7.4