You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avutil/attributes: don't force format checking to __gnu_printf__ on mingw build
Use __MINGW_{PRINTF,SCANF}_FORMAT which matches the format check for
implementation that is actually used.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
4
configure
vendored
4
configure
vendored
@@ -6225,8 +6225,6 @@ probe_libc(){
|
||||
if ! test_${pfx}cpp_condition crtdefs.h "defined(_UCRT)"; then
|
||||
add_${pfx}cppflags -D__USE_MINGW_ANSI_STDIO=1
|
||||
fi
|
||||
eval test \$${pfx_no_}cc_type = "gcc" &&
|
||||
add_${pfx}cppflags -D__printf__=__gnu_printf__
|
||||
test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
|
||||
add_${pfx}cppflags -D_WIN32_WINNT=0x0600
|
||||
add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
|
||||
@@ -6244,8 +6242,6 @@ probe_libc(){
|
||||
add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
|
||||
test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
|
||||
add_${pfx}cppflags -D_WIN32_WINNT=0x0600
|
||||
eval test \$${pfx_no_}cc_type = "gcc" &&
|
||||
add_${pfx}cppflags -D__printf__=__gnu_printf__
|
||||
add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
|
||||
elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
|
||||
eval ${pfx}libc_type=msvcrt
|
||||
|
||||
@@ -172,11 +172,36 @@
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define av_builtin_constant_p __builtin_constant_p
|
||||
# define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
|
||||
# define av_scanf_format(fmtpos, attrpos) __attribute__((__format__(__scanf__, fmtpos, attrpos)))
|
||||
#else
|
||||
# define av_builtin_constant_p(x) 0
|
||||
#endif
|
||||
|
||||
// for __MINGW_PRINTF_FORMAT and __MINGW_SCANF_FORMAT
|
||||
#ifdef __MINGW32__
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW_PRINTF_FORMAT
|
||||
# define AV_PRINTF_FMT __MINGW_PRINTF_FORMAT
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
# define AV_PRINTF_FMT __printf__
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW_SCANF_FORMAT
|
||||
# define AV_SCANF_FMT __MINGW_SCANF_FORMAT
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
# define AV_SCANF_FMT __scanf__
|
||||
#endif
|
||||
|
||||
#ifdef AV_PRINTF_FMT
|
||||
# define av_printf_format(fmtpos, attrpos) __attribute__((format(AV_PRINTF_FMT, fmtpos, attrpos)))
|
||||
#else
|
||||
# define av_printf_format(fmtpos, attrpos)
|
||||
#endif
|
||||
|
||||
#ifdef AV_SCANF_FMT
|
||||
# define av_scanf_format(fmtpos, attrpos) __attribute__((format(AV_SCANF_FMT, fmtpos, attrpos)))
|
||||
#else
|
||||
# define av_scanf_format(fmtpos, attrpos)
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user