[FFmpeg-cvslog] configure: Don' t force _WIN32_WINNT to an older version if targeting winphone/winrt

Martin Storsjö git at videolan.org
Tue Jul 28 22:39:03 CEST 2015


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Jul 24 23:12:43 2015 +0300| [c6e0829e3696c894d24c8088c3ee30a9c17534c2] | committer: Martin Storsjö

configure: Don't force _WIN32_WINNT to an older version if targeting winphone/winrt

This avoids having to manually set _WIN32_WINNT in --extra-cflags
when targeting these API families, which only was necessary to
work around configure setting _WIN32_WINNT to an older version
by default.

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

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

 configure |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 43884ae..482be43 100755
--- a/configure
+++ b/configure
@@ -3794,8 +3794,19 @@ probe_libc(){
         # 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.
+        # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
+        # family. For these cases, configure is free to use any functions
+        # found in the SDK headers by default. (Alternatively, we could force
+        # _WIN32_WINNT to 0x0602 in that case.)
         check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
-            add_${pfx}cppflags -D_WIN32_WINNT=0x0502
+            { check_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0502; }
+#ifdef WINAPI_FAMILY
+#include <winapifamily.h>
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#error not desktop
+#endif
+#endif
+EOF
     elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
         eval ${pfx}libc_type=klibc
     elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then



More information about the ffmpeg-cvslog mailing list