[10/10] configure: Only redirect strtoll to _strtoi64 if necessary

Message ID 1437904678-19444-10-git-send-email-martin@martin.st
State Committed
Commit 342b0ba5f93b09b1d0c2597db44605300e6fcc53
Headers show

Commit Message

Martin Storsjö July 26, 2015, 9:57 a.m.
This isn't necessary any longer on MSVC 2013.
---
 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Jean-Baptiste Kempf July 26, 2015, 11:03 a.m. | #1
On 26 Jul, Martin Storsjö wrote :
> This isn't necessary any longer on MSVC 2013.

I agree with the patch, but IIRC, it can still fail on MSVC 2013, if you
don't have the latest version (4).

With my kindest regards,
Hendrik Leppkes July 26, 2015, 11:10 a.m. | #2
On Sun, Jul 26, 2015 at 1:03 PM, Jean-Baptiste Kempf <jb@videolan.org> wrote:
> On 26 Jul, Martin Storsjö wrote :
>> This isn't necessary any longer on MSVC 2013.
>
> I agree with the patch, but IIRC, it can still fail on MSVC 2013, if you
> don't have the latest version (4).

Well the configure check will catch any failure, no matter from which
version, so thats fine. Patch LGTM.
Martin Storsjö July 26, 2015, 11:17 a.m. | #3
On Sun, 26 Jul 2015, Jean-Baptiste Kempf wrote:

> On 26 Jul, Martin Storsjö wrote :
>> This isn't necessary any longer on MSVC 2013.
>
> I agree with the patch, but IIRC, it can still fail on MSVC 2013, if you
> don't have the latest version (4).

Hmm, possibly, I might have used that version for testing. (I don't 
remember which version I've packaged for my wine setups, where I do most 
of the testing.)

Anyway, as long as the test doesn't check for versions but for actual 
functionality, this should (hopefully) work regardless what version I 
claim in the commit message.

// Martin
Jean-Baptiste Kempf July 26, 2015, 1:06 p.m. | #4
On 26 Jul, Martin Storsjö wrote :
> On Sun, 26 Jul 2015, Jean-Baptiste Kempf wrote:
> 
> >On 26 Jul, Martin Storsjö wrote :
> >>This isn't necessary any longer on MSVC 2013.
> >
> >I agree with the patch, but IIRC, it can still fail on MSVC 2013, if you
> >don't have the latest version (4).
> 
> Hmm, possibly, I might have used that version for testing. (I don't remember
> which version I've packaged for my wine setups, where I do most of the
> testing.)
> 
> Anyway, as long as the test doesn't check for versions but for actual
> functionality, this should (hopefully) work regardless what version I claim
> in the commit message.

Yes. Which is why I said "I agree with the patch".

With my kindest regards,

Patch

diff --git a/configure b/configure
index ab174f2..5368cf0 100755
--- a/configure
+++ b/configure
@@ -3062,7 +3062,7 @@  probe_cc(){
         _ld_lib='lib%.a'
         _ld_path='-libpath:'
         _flags='-nologo'
-        _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dstrtoll=_strtoi64'
+        _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS'
     elif $_cc 2>&1 | grep -q Intel; then
         _type=icl
         _ident=$($_cc 2>&1 | head -n1)
@@ -3085,7 +3085,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 -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS'
+        _cflags='-D_USE_MATH_DEFINES -Qms0 -Qvec- -Qsimd- -GS'
     elif $_cc --version 2>/dev/null | grep -q ^cparser; then
         _type=cparser
         _ident=$($_cc --version | head -n1)
@@ -4745,6 +4745,7 @@  elif enabled_any msvc icl; then
 __declspec($_restrict) void* foo(int);
 EOF
     fi
+    check_func strtoll || add_cflags -Dstrtoll=_strtoi64
 fi
 
 for pfx in "" host_; do