# MinGW64 is backwards compatible with MinGW32, so check for it first.
elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
eval ${pfx}libc_type=mingw64
+ if check_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
+ add_compat msvcrt/snprintf.o
+ add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
+ fi
add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
- elif check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
+ 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
check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
(__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||