[FFmpeg-cvslog] configure: msvc: Set the target windows version to XP if no target is set

Martin Storsjö git at videolan.org
Mon May 20 10:51:50 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed May 15 23:51:49 2013 +0300| [0b6899f154347cdd0aa66c5ec16ed9c65871766f] | committer: Martin Storsjö

configure: msvc: Set the target windows version to XP if no target is set

MSVC 2010 (or more precisely, Windows SDK 7.0 which comes with MSVC
2010) sets _WIN32_WINNT to the constant for Windows 7 if nothing is
set. This could lead to the libav configure script detecting and
using functions only present in Windows 7 or newer, which in most
cases isn't desired. If the caller explicitly wants this, the caller
can add the _WIN32_WINNT define via --extra-cflags, setting the desired
version.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0b6899f154347cdd0aa66c5ec16ed9c65871766f
---

 configure |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/configure b/configure
index f39a860..bf511ed 100755
--- a/configure
+++ b/configure
@@ -3201,6 +3201,13 @@ elif check_func_headers stdlib.h _get_doserrno; then
     add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf   \
                                  _snprintf=avpriv_snprintf  \
                                  vsnprintf=avpriv_vsnprintf
+    # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
+    # 0x601 by default unless something else is set by the user.
+    # This can easily lead to us detecting functions only present
+    # in such new versions and producing binaries requiring windows 7.0.
+    # Therefore explicitly set the default to XP unless the user has
+    # set something else on the command line.
+    check_cpp_condition stdlib.h "defined(_WIN32_WINNT)" || add_cppflags -D_WIN32_WINNT=0x0502
 elif check_cpp_condition stddef.h "defined __KLIBC__"; then
     libc_type=klibc
 fi



More information about the ffmpeg-cvslog mailing list