build: Define __printf__ to __gnu_printf__ on MinGW*/gcc

This is necessary to avoid GCC assuming MS style printf arguments.
This commit is contained in:
Diego Biurrun 2013-12-13 23:19:55 +01:00
parent 6d3ea1957f
commit 11bb5e10c3
1 changed files with 5 additions and 0 deletions

5
configure vendored
View File

@ -3401,6 +3401,7 @@ esac
probe_libc(){
pfx=$1
pfx_no_=${pfx%_}
# uclibc defines __GLIBC__, so it needs to be checked before glibc.
if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
eval ${pfx}libc_type=uclibc
@ -3416,6 +3417,8 @@ probe_libc(){
elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
eval ${pfx}libc_type=mingw64
add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
eval test \$${pfx_no_}cc_type = "gcc" &&
add_${pfx}cppflags -D__printf__=__gnu_printf__
elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
eval ${pfx}libc_type=mingw32
@ -3423,6 +3426,8 @@ probe_libc(){
(__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
die "ERROR: MinGW32 runtime version must be >= 3.15."
add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
eval test \$${pfx_no_}cc_type = "gcc" &&
add_${pfx}cppflags -D__printf__=__gnu_printf__
elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
eval ${pfx}libc_type=msvcrt
# The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to