diff --git a/configure b/configure
index 4e1d32e8ceba710f505be1177ef88ad0a4b9988f..c29c220422b315e485b5dc8549e29ca5db15d739 100755
--- a/configure
+++ b/configure
@@ -3627,6 +3627,8 @@ elif check_header _mingw.h; then
             __MINGW64_VERSION_MAJOR < 3"; then
         add_compat msvcrt/snprintf.o
         add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
+    else
+        add_cppflags -D__USE_MINGW_ANSI_STDIO=1
     fi
 elif check_func_headers stdlib.h _get_doserrno; then
     libc_type=msvcrt