From cc10c53333673fc9b8645001d9efad26eda35223 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Mon, 23 May 2022 22:16:34 +0800 Subject: [PATCH] nir: Fixes MSVC compiling error about unused variable `_` Fixes: 836470d4331 ("nir: allow NIR_PASS(_, )") MSVC compiling error: ``` nir/nir_lower_shader_calls.c ../mesa/src/compiler/nir/nir_lower_shader_calls.c(1188): error C2220: the following warning is treated as an error ../mesa/src/compiler/nir/nir_lower_shader_calls.c(1188): warning C4101: '_': unreferenced local variable ../mesa/src/compiler/nir/nir_lower_shader_calls.c(1190): warning C4101: '_': unreferenced local variable ``` Signed-off-by: Yonggang Luo Reviewed-by: Erik Faye-Lund Reviewed-by: Jesse Natalie Part-of: --- src/util/macros.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/macros.h b/src/util/macros.h index 7c6df7e58ba..2138f5d662d 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -299,6 +299,8 @@ do { \ */ #ifdef HAVE_FUNC_ATTRIBUTE_UNUSED #define UNUSED __attribute__((unused)) +#elif defined (_MSC_VER) +#define UNUSED __pragma(warning(suppress:4100 4101)) #else #define UNUSED #endif