From: Jacek Caban jacek@codeweavers.com
--- include/private/vkd3d_common.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h index 619665ad3..e69832b43 100644 --- a/include/private/vkd3d_common.h +++ b/include/private/vkd3d_common.h @@ -75,18 +75,20 @@ static inline size_t align(size_t addr, size_t alignment) return (addr + (alignment - 1)) & ~(alignment - 1); }
-#ifdef __GNUC__ +#ifdef __MINGW_PRINTF_FORMAT +# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, args))) +#elif defined(__GNUC__) +# define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args))) +#else +# define VKD3D_PRINTF_FUNC(fmt, args) +#endif + +#if defined(__GNUC__) || defined(__clang__) # define VKD3D_NORETURN __attribute__((noreturn)) -# ifdef __MINGW_PRINTF_FORMAT -# 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)) # define VKD3D_UNREACHABLE __builtin_unreachable() #else # define VKD3D_NORETURN -# define VKD3D_PRINTF_FUNC(fmt, args) # define VKD3D_UNUSED # define VKD3D_UNREACHABLE (void)0 #endif /* __GNUC__ */