The default for MinGW is always ms_printf rather than gnu_printf, but if we are using ucrtbase or ANSI stdio, we want gnu_printf.
From: Zebediah Figura zfigura@codeweavers.com
The default for MinGW is always ms_printf rather than gnu_printf, but if we are using ucrtbase or ANSI stdio, we want gnu_printf. --- include/private/vkd3d_common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h index c041b52d..349b1acf 100644 --- a/include/private/vkd3d_common.h +++ b/include/private/vkd3d_common.h @@ -54,7 +54,11 @@ static inline size_t align(size_t addr, size_t alignment)
#ifdef __GNUC__ # define VKD3D_NORETURN __attribute__((noreturn)) -# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args))) +# if defined(__MINGW32__) +# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, args))) +# else +# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args))) +# endif # define VKD3D_UNUSED __attribute__((unused)) #else # define VKD3D_NORETURN
+# if defined(__MINGW32__) +# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, args))) +# else +# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args))) +# endif
Should we just check whether __MINGW_PRINTF_FORMAT is defined instead of __MINGW32__?
On 9/27/22 05:28, Henri Verbeet (@hverbeet) wrote:
+# if defined(__MINGW32__) +# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, args))) +# else +# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args))) +# endif
Should we just check whether __MINGW_PRINTF_FORMAT is defined instead of __MINGW32__?
I don't think it makes a difference, but sure, that works too.