Closed Bug 838537 Opened 11 years ago Closed 11 years ago

Unable to Build with VS2008SP1/VC9 since Bug 836927

Categories

(Core :: Audio/Video, defect)

x86_64
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: philip.chee, Assigned: philip.chee)

References

Details

Attachments

(1 file)

WMFByteStream.cpp
c:\t1\hg\comm-central\mozilla\config\rules.mk:1010:0$ c:/t1/hg/objdir-sm/mozilla/_virtualenv/Scripts
/python.exe -O c:/t1/hg/comm-central/mozilla/build/cl.py cl -FoWMFByteStream.obj -c -D_HAS_EXCEPTION
S=0 -I../../../dist/stl_wrappers  -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XP
TC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DMOZ_SUITE=1 -DN
O_NSPR_10_SUPPORT  -Ic:/t1/hg/comm-central/mozilla/content/media/wmf -I. -I../../../dist/include  -I
c:/t1/hg/objdir-sm/mozilla/dist/include/nspr -Ic:/t1/hg/objdir-sm/mozilla/dist/include/nss        -T
P -nologo -W3 -Gy -Fdgenerated.pdb -wd4345 -wd4351 -wd4482 -wd4800 -wd4819 -we4553 -GR- -DNOMINMAX
-DNDEBUG -DTRIMMED -Zi -UDEBUG -DNDEBUG -O1 -Oy  -MD            -FI ../../../dist/include/mozilla-config.h -DMOZILLA_CLIENT  c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp
WMFByteStream.cpp
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(291) : error C2039: 'min' : is not a member of 'std'
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(291) : error C2065: 'min' : undeclared identifier
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(291) : error C2275: 'int64_t' : illegal use of this type as an expression
        c:\t1\hg\objdir-sm\mozilla\dist\include\mozilla/MSStdInt.h(89) : see declaration of 'int64_t'
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(502) : error C2039: 'min' : is not a member of 'std'
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(502) : error C2065: 'min' : undeclared identifier
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(502) : error C2275: 'int64_t' : illegal use of this type as an expression
        c:\t1\hg\objdir-sm\mozilla\dist\include\mozilla/MSStdInt.h(89) : see declaration of 'int64_t'
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(522) : error C2039: 'min' : is not a member of 'std'
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(522) : error C2065: 'min' : undeclared identifier
c:/t1/hg/comm-central/mozilla/content/media/wmf/WMFByteStream.cpp(522) : error C2275: 'int64_t' : illegal use of this type as an expression
        c:\t1\hg\objdir-sm\mozilla\dist\include\mozilla/MSStdInt.h(89) : see declaration of 'int64_t'
This lets my VC9 build continue. Someone needs to see if this doesn't break VC10
Assignee: nobody → philip.chee
Status: NEW → ASSIGNED
Attachment #710634 - Flags: review?(paul)
Comment on attachment 710634 [details] [diff] [review]
Patch v1.0 #include <algorithm>

Review of attachment 710634 [details] [diff] [review]:
-----------------------------------------------------------------

This works fine on VS2010.
Attachment #710634 - Flags: review?(paul) → review+
I've landed that, a couple people complained on IRC that they could not compile.

https://hg.mozilla.org/integration/mozilla-inbound/rev/bebb0d153de0
This works fine.  My only question is, does it make more sense to put the #include in WMF.h so that std::min/std::max work in the entire directory rather than just in this one file?
I think the general rule is that a file should only include what it needs.
It's more robust to changes, and it's easier to see the dependencies that way.
It's also less work for the compiler.
https://hg.mozilla.org/mozilla-central/rev/bebb0d153de0
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
(In reply to Mats Palmgren [:mats] from comment #5)
> I think the general rule is that a file should only include what it needs.
> It's more robust to changes, and it's easier to see the dependencies that
> way.
> It's also less work for the compiler.

That is why I CC'd you on the bug, since you did the original std::min/std::max patch.  we should follow what was done elsewhere.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: