radv: Update radv_assert for MSVC

MSVC hates parentheses in radv_assert, so replace with do/while(0).

Also switch nonstandard DEBUG with standard NDEBUG, which Aco uses.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>
This commit is contained in:
James Park 2020-11-26 19:08:57 -08:00 committed by Marge Bot
parent 02481e1203
commit be42e9a6d1

View file

@ -234,13 +234,13 @@ void radv_logi_v(const char *format, va_list va);
} while (0)
/* A non-fatal assert. Useful for debugging. */
#ifdef DEBUG
#define radv_assert(x) ({ \
if (unlikely(!(x))) \
fprintf(stderr, "%s:%d ASSERT: %s\n", __FILE__, __LINE__, #x); \
})
#else
#ifdef NDEBUG
#define radv_assert(x) do {} while(0)
#else
#define radv_assert(x) do { \
if (unlikely(!(x))) \
fprintf(stderr, "%s:%d ASSERT: %s\n", __FILE__, __LINE__, #x); \
} while (0)
#endif
#define stub_return(v) \