Annotate printf functions with gnu_printf format under MingW

Fixes https://github.com/harfbuzz/harfbuzz/issues/5080
This commit is contained in:
Khaled Hosny 2025-02-20 21:36:02 +02:00
parent a8fd29718a
commit f012442f98

View file

@ -282,7 +282,9 @@ extern "C" void hb_free_impl(void *ptr);
#define __attribute__(x)
#endif
#if defined(__GNUC__) && (__GNUC__ >= 3)
#if defined(__MINGW32__) && (__GNUC__ >= 3)
#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)))
#else
#define HB_PRINTF_FUNC(format_idx, arg_idx)