Closed Bug 890211 Opened 11 years ago Closed 11 years ago

WebRTC fail to compile using Visual Studio 2013

Categories

(Firefox Build System :: General, defect)

x86
Windows 8
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: xavier114fch, Unassigned)

References

Details

Attachments

(2 files)

Attached file Error log for MediaPipeline.cpp (deleted) —
There are 2 sets of issues:
1) std::max and std::min needs include <algorithm> to compile.
2) Several errors when MediaPipeline.cpp is compiled:

71:18.77 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\inttypes
.h(237) : error C2084: function '__int64 abs(__int64) throw()' already has a bod
y
71:18.77
71:18.77         C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\
stdlib.h(501) : see previous definition of 'abs'
71:18.77
71:18.77 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\inttypes
.h(242) : error C2556: 'imaxdiv_t div(intmax_t,intmax_t)' : overloaded function
differs only by return type from 'lldiv_t div(__int64,__int64) throw()'
71:18.77
71:18.77         C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\
stdlib.h(509) : see declaration of 'div'
71:18.77
71:18.79 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\inttypes
.h(242) : error C2371: 'div' : redefinition; different basic types
71:18.79
71:18.79         C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\
stdlib.h(509) : see declaration of 'div'
This is the patch to fix issue 1 I can discover so far.
(In reply to Xavier Fung from comment #0)
> Created attachment 771257 [details]
> Error log for MediaPipeline.cpp
> 
> There are 2 sets of issues:
> 1) std::max and std::min needs include <algorithm> to compile.
> 2) Several errors when MediaPipeline.cpp is compiled:
> 
> 71:18.77 C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\INCLUDE\inttypes
> .h(237) : error C2084: function '__int64 abs(__int64) throw()' already has a
> bod
> y
> 71:18.77
> 71:18.77         C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\INCLUDE\
> stdlib.h(501) : see previous definition of 'abs'
> 71:18.77
> 71:18.77 C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\INCLUDE\inttypes
> .h(242) : error C2556: 'imaxdiv_t div(intmax_t,intmax_t)' : overloaded
> function
> differs only by return type from 'lldiv_t div(__int64,__int64) throw()'
> 71:18.77
> 71:18.77         C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\INCLUDE\
> stdlib.h(509) : see declaration of 'div'
> 71:18.77
> 71:18.79 C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\INCLUDE\inttypes
> .h(242) : error C2371: 'div' : redefinition; different basic types
> 71:18.79
> 71:18.79         C:\Program Files (x86)\Microsoft Visual Studio
> 12.0\VC\INCLUDE\
> stdlib.h(509) : see declaration of 'div'

This is a bug of VS2013.  I already file this to https://connect.microsoft.com/VisualStudio/feedback/details/792397/.
Blocks: VC12
remove the including of  inttypes.h, then this is fixed.
(In reply to zhoubcfan from comment #4)
> remove the including of  inttypes.h, then this is fixed.

The <algorithm> changes are still needed.

Can we get this patch reviewed and checked in?
VS 2013 RTM can compile WebRTC without any changes.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Well that's strange. In general, <algorithm> is still needed for min/max (for example, bug 892859 still stands). And I haven't updated my local code, so it wasn't a change on the WebRTC side. So I guess that means that somehow <algorithm> got pulled in by some internal VC header changes.

But anyway, I can confirm that VS2013 RTM can compile WebRTC without this patch.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: