util: fix unknown pragma warning on msvc

MSVC has no idea about these pragmas, and spews warnings about them,
making it hard to spot real problems. So let's only use these macros on
GCC.

Fixes: 2ec290cd92 ("util: Fix/silence variable shadowing warnings")
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7633>
This commit is contained in:
Erik Faye-Lund 2020-11-16 11:39:44 +01:00 committed by Marge Bot
parent 2f5b3ac2f8
commit ff3b4f6683

View file

@ -383,8 +383,10 @@ typedef void (*util_format_fetch_rgba_func_ptr)(void *dst, const uint8_t *src,
unsigned i, unsigned j);
/* Silence warnings triggered by sharing function/struct names */
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#endif
const struct util_format_description *
util_format_description(enum pipe_format format) ATTRIBUTE_CONST;
@ -393,7 +395,9 @@ util_format_pack_description(enum pipe_format format) ATTRIBUTE_CONST;
const struct util_format_unpack_description *
util_format_unpack_description(enum pipe_format format) ATTRIBUTE_CONST;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
/**
* Returns a function to fetch a single pixel (i, j) from a block.