[2/3] configure: Move defines for controlling MSVCRT headers to the CRT detection section

Message ID 1469390253-2666-2-git-send-email-martin@martin.st
State Committed
Commit 79fb0692992c74214c6cf8e81350fc93eeffc5ec
Headers show

Commit Message

Martin Storsjö July 24, 2016, 7:57 p.m.
This allows these flags to be automatically enabled for clang,
when using MSVCRT headers.
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Diego Biurrun July 25, 2016, 9:07 a.m. | #1
On Sun, Jul 24, 2016 at 10:57:32PM +0300, Martin Storsjö wrote:
> This allows these flags to be automatically enabled for clang,
> when using MSVCRT headers.
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

OK

Diego

Patch

diff --git a/configure b/configure
index d585560..78951d4 100755
--- a/configure
+++ b/configure
@@ -3238,7 +3238,6 @@  probe_cc(){
         _ld_lib='lib%.a'
         _ld_path='-libpath:'
         _flags='-nologo'
-        _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS'
     elif $_cc 2>&1 | grep -q Intel; then
         _type=icl
         _ident=$($_cc 2>&1 | head -n1)
@@ -3261,7 +3260,7 @@  probe_cc(){
         _flags='-nologo -Qdiag-error:4044,10157'
         # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
         # with MSVC which enables it by default.
-        _cflags='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS'
+        _cflags='-Qms0 -Qvec- -Qsimd- -GS'
     elif $_cc --version 2>/dev/null | grep -q ^cparser; then
         _type=cparser
         _ident=$($_cc --version | head -n1)
@@ -3988,6 +3987,7 @@  probe_libc(){
                                              vsnprintf=avpriv_vsnprintf
             fi
         fi
+        add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
         # 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