mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
util: better fix for unused variable warnings with asserts
Modify the non-debug (ie disabled) version of assert to expose the value in the expression to the compiler (avoiding the unused variable messages) while still expanding to a noop.
This commit is contained in:
parent
31d1822473
commit
f0ba7d897d
1 changed files with 1 additions and 1 deletions
|
|
@ -188,7 +188,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) do { } while (0 && (expr))
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue