From 5a5ab3e8806c2b2a5006d53b75e79b6c90fe810e Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 6 May 2023 17:14:04 +0300 Subject: utils: fix printf format warnings on mingw See: https://github.com/mesonbuild/wrapdb/pull/819 https://github.com/Exiv2/exiv2/blob/c86ae6acf597304db37246434ebc393d732c22c2/src/image_int.hpp#L15 https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/ Signed-off-by: Ran Benita --- src/utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils.h b/src/utils.h index eec7f10..aacb4a2 100644 --- a/src/utils.h +++ b/src/utils.h @@ -269,7 +269,9 @@ check_eaccess(const char *path, int mode) # define XKB_EXPORT #endif -#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203) +#if defined(__MINGW32__) +# define ATTR_PRINTF(x,y) __attribute__((__format__(__MINGW_PRINTF_FORMAT, x, y))) +#elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203) # define ATTR_PRINTF(x,y) __attribute__((__format__(__printf__, x, y))) #else /* not gcc >= 2.3 */ # define ATTR_PRINTF(x,y) -- cgit v1.2.1