[Mesa-dev] [PATCH 1/3] anv: use do { } while (0) in the anv_finishme macro
Kenneth Graunke
kenneth at whitecape.org
Fri Nov 25 20:40:49 UTC 2016
On Thursday, November 24, 2016 6:18:13 PM PST Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Use the generic construct instead of the currect GCC specific one.
>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> Suggested-by: Kenneth Graunke <kenneth at whitecape.org>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> src/intel/vulkan/anv_private.h | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
> index 2fc543d..edc008d 100644
> --- a/src/intel/vulkan/anv_private.h
> +++ b/src/intel/vulkan/anv_private.h
> @@ -207,13 +207,14 @@ void anv_loge_v(const char *format, va_list va);
> /**
> * Print a FINISHME message, including its source location.
> */
> -#define anv_finishme(format, ...) ({ \
> - static bool reported = false; \
> - if (!reported) { \
> - __anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); \
> - reported = true; \
> - } \
> -})
> +#define anv_finishme(format, ...) \
> + do { \
> + static bool reported = false; \
> + if (!reported) { \
> + __anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); \
> + reported = true; \
> + } \
> + } while (0)
>
> /* A non-fatal assert. Useful for debugging. */
> #ifdef DEBUG
>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161125/0eab1347/attachment-0001.sig>
More information about the mesa-dev
mailing list