MSVC does support most of C99 since the 2013 version. Try to
detect whether the compiler in the path needs to run the C99
converter or not. When the converter is omitted, compilation
time is reduced quite drastically.

Prior to this, users could still use --cc="c99conv -noconv cl"
when running MSVC 2013 to achieve the same.

Since this only affects the value of cc_default, before the
compiler itself is detected and set up (and this is ignored if the
user explicitly set a separate compiler using --cc), we can't use
the normal check_cc macro.
---
 configure |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/configure b/configure
index 36bee8f..e530aba 100755
--- a/configure
+++ b/configure
@@ -2342,6 +2342,15 @@ case "$toolchain" in
     ;;
     msvc)
         cc_default="c99wrap cl"
+        # Check whether cl.exe supports C99 or not. From MSVC 2013 onwards,
+        # it does support C99, but we still need to use c99wrap for passing
+        # command line parameters with a space (for avoiding msys path
+        # mangling/conversion issues).
+        cat <<EOF > $TMPC
+            struct s { int a, b; } a = { .b = 42 };
+EOF
+        check_cmd c99wrap -noconv cl -c -Fo $TMPO $TMPC &&
+            cc_default="c99wrap -noconv cl"
         ld_default="c99wrap link"
         nm_default="dumpbin -symbols"
         ar_default="lib"
-- 
1.7.9.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to