Module: Mesa Branch: master Commit: 89b01cc02522d50843710242934daaab6687af97 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=89b01cc02522d50843710242934daaab6687af97
Author: Michel Zou <[email protected]> Date: Sat Nov 21 13:34:18 2020 +0100 util: fix mingw format-extra-args warning Reviewed-by: Jose Fonseca <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713> --- src/util/macros.h | 7 ++++++- src/util/u_debug.h | 6 +----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/util/macros.h b/src/util/macros.h index 98ce8bbf61d..6856e48cdfc 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -24,6 +24,7 @@ #ifndef UTIL_MACROS_H #define UTIL_MACROS_H +#include <stdio.h> #include <assert.h> #include "c99_compat.h" @@ -126,7 +127,11 @@ do { \ #endif #ifdef HAVE_FUNC_ATTRIBUTE_FORMAT -#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) +#if defined (__MINGW_PRINTF_FORMAT) +# define PRINTFLIKE(f, a) __attribute__ ((format(__MINGW_PRINTF_FORMAT, f, a))) +#else +# define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) +#endif #else #define PRINTFLIKE(f, a) #endif diff --git a/src/util/u_debug.h b/src/util/u_debug.h index fc06c582b0d..6318f39dd56 100644 --- a/src/util/u_debug.h +++ b/src/util/u_debug.h @@ -54,11 +54,7 @@ extern "C" { #endif -#if defined(__GNUC__) -#define _util_printf_format(fmt, list) __attribute__ ((format (printf, fmt, list))) -#else -#define _util_printf_format(fmt, list) -#endif +#define _util_printf_format(fmt, list) PRINTFLIKE(fmt, list) void _debug_vprintf(const char *format, va_list ap); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
