util: fix mingw format-extra-args warning

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7713>
This commit is contained in:
Michel Zou
2020-11-21 13:34:18 +01:00
committed by Marge Bot
parent 5f6c5e5b86
commit 89b01cc025
2 changed files with 7 additions and 6 deletions

View File

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