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 <ran@unusedvar.com>
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)