summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-01-31 08:31:04 +0100
committerUoti Urpala <uau@mplayer2.org>2012-03-01 00:22:29 +0200
commiteebe9309ecd70f86f0a52f09712db833df589206 (patch)
treee7c41b0a5f2f6df9b2d5c7acd74c44c9d390dbf5 /configure
parent3dbb18d91a0d4b17f0187e3b5faa3b6f3cd1b31e (diff)
downloadmpv-eebe9309ecd70f86f0a52f09712db833df589206.tar.bz2
mpv-eebe9309ecd70f86f0a52f09712db833df589206.tar.xz
configure: add __USE_MINGW_ANSI_STDIO on MinGW
This makes MinGW redirect certain stdio functions (such as the sprintf family) from the MSVCRT libc to a standard compliant MinGW implementation. This fixes a crash in talloc.c when compiling mplayer with MinGW-w64. The problem is most likely with talloc_vasprintf(), which calls vsnprintf with a small buffer and checks its return value to find out how much space the formatted string requires. Without this commit, vsnprintf would always return -1, and then the code calls abort(). (lachs0r figured out this one.)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure1
1 files changed, 1 insertions, 0 deletions
diff --git a/configure b/configure
index 1b66ca7b17..fd3bfc83bd 100755
--- a/configure
+++ b/configure
@@ -1397,6 +1397,7 @@ fi
if mingw32 ; then
_getch=getch2-win.c
need_shmem=no
+ extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
fi
if amigaos ; then