Use gnu_printf format annotation under MingW with GCC only

Fixes https://github.com/harfbuzz/harfbuzz/issues/5106
This commit is contained in:
Khaled Hosny 2025-03-06 22:07:17 +02:00
parent 462a54895b
commit 123a0d68a1

View file

@ -282,7 +282,7 @@ extern "C" void hb_free_impl(void *ptr);
#define __attribute__(x)
#endif
#if defined(__MINGW32__) && (__GNUC__ >= 3)
#if defined(__MINGW32__) && (__GNUC__ >= 3) && !defined(__clang__)
#define HB_PRINTF_FUNC(format_idx, arg_idx) __attribute__((__format__ (gnu_printf, format_idx, arg_idx)))
#elif defined(__GNUC__) && (__GNUC__ >= 3)
#define HB_PRINTF_FUNC(format_idx, arg_idx) __attribute__((__format__ (__printf__, format_idx, arg_idx)))