nir: Fixes MSVC compiling error about unused variable _

Fixes: 836470d433 ("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 <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16666>
This commit is contained in:
Yonggang Luo
2022-05-23 22:16:34 +08:00
committed by Marge Bot
parent 836ff4b586
commit cc10c53333

View File

@@ -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