Since 16th dec 2011 I get this compile error when using --disable-ogg in configure (I am building Thunderbird so ogg really isn't needed): /usr/local/TB-hg/mozilla/content/xml/document/src/nsXMLContentSink.cpp: In member function 'nsresult nsXMLContentSink::HandleStartElement(const PRUnichar*, const PRUnichar**, PRUint32, PRInt /usr/local/TB-hg/mozilla/content/xml/document/src/nsXMLContentSink.cpp:1081:33: error: 'audio' is not a member of 'nsGkAtoms' /usr/local/TB-hg/mozilla/content/xml/document/src/nsXMLContentSink.cpp:1082:33: error: 'video' is not a member of 'nsGkAtoms' gmake: *** [nsXMLContentSink.o] Error 1
Summary: --disable-ogg configure option breaks build after bug 689384 → --disable-ogg configure option breaks build after bug 689834
The problem is that nsGkAtoms::audio and nsGkAtoms::video are #ifdef MOZ_MEDIA. They need to be wrapped inside an #ifdef MOZ_MEDIA, like in http://mxr.mozilla.org/mozilla-central/source/content/xml/document/src/nsXMLContentSink.cpp#567
Lines 1081 and 1082 should be wrapped in #ifdef MOZ_MEDIA ? OK, I can try that.
It needed some more places to fix, but thanks for the hint.
Attachment #589580 - Flags: review?(bzbarsky)
Comment on attachment 589580 [details] [diff] [review] fix compile r=me
Attachment #589580 - Flags: review?(bzbarsky) → review+
Completely optional, but if you wanted to make the patch look a little cleaner, you could move the nsGkAtoms::audio and nsGkAtoms::video if statement checks into the middle of the if block, so that you don't have the || hanging out all by itself
Yeah, I thought it is ugly :) But could it produce slower code? Is there shortcut evaluation of logical expression in some C++ compiler? If yes, then the least common nsGkAtoms values should be placed last (as it is now). So that the more common comparisons decide the result sooner and the execution can skip the less common ones.
Logical expressions are always shortcut-evaluated in C++. A compiler could observe that the order doesn't matter here (due to lack of side-effects) and reorder the tests if it wanted, of course. That's sort of dangerous for a compiler to do, though.
Thanks. So you agree with me? Should I leave the order as is? I assume the 'audio' and 'video' values are the least common so the evaluation will usually finish before reaching them.
Yeah, just leave the order. I don't think it matters for performance, but a lot of the code involved is on the chopping block anyway... (and I think so should be the MOZ_MEDIA ifdefs).
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.