Mesa (master): util: fix debug_assert() to avoid unused variable warnings in release builds

Keith Whitwell keithw at kemper.freedesktop.org
Thu Mar 12 16:57:40 UTC 2009


Module: Mesa
Branch: master
Commit: d885c9dad15b64fd40c4c4d5cda6713a3e06a9ae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d885c9dad15b64fd40c4c4d5cda6713a3e06a9ae

Author: Keith Whitwell <keithw at vmware.com>
Date:   Thu Mar 12 16:56:24 2009 +0000

util: fix debug_assert() to avoid unused variable warnings in release builds

---

 src/gallium/auxiliary/util/u_debug.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h
index b298b9b..7c82970 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -162,7 +162,7 @@ void _debug_assert_fail(const char *expr,
 #ifdef DEBUG
 #define debug_assert(expr) ((expr) ? (void)0 : _debug_assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__))
 #else
-#define debug_assert(expr) ((void)0)
+#define debug_assert(expr) ((void)(expr))
 #endif
 
 




More information about the mesa-commit mailing list