Closed Bug 587329 Opened 14 years ago Closed 14 years ago

mozilla/content/html/content/src/nsHTMLTimeRanges.cpp:51: error: 'eDOMClassInfo_nsHTMLTimeRanges_id' was not declared in this scope

Categories

(Core :: Audio/Video, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b5

People

(Reporter: ishikawa, Assigned: cpearce)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729; .NET4.0C)
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0b4pre) Gecko/20100814 Thunderbird/3.2a1pre

Compilation without MOZ_MEDIA.
I am disabling media related features in my MOZCONFIG.
This seems to trigger this compilation problem.

When I tried to build TB3 from comm-central, there was this error:

 ./mozilla/content/html/content/src/nsHTMLTimeRanges.cpp:51: error:
'eDOMClassInfo_nsHTMLTimeRanges_id' was not declared in this scope
make[8]: *** [nsHTMLTimeRanges.o] Error 1


I searched  HTMLTimeRanges using mxr.mozilla.org and
found the following code snippet:
http://mxr.mozilla.org/comm-central/source/mozilla/dom/base/nsDOMClassInfoClasses.h

430 #if defined(MOZ_MEDIA)
431 // WhatWG Video Element
432 DOMCI_CLASS(HTMLVideoElement)
433 DOMCI_CLASS(HTMLSourceElement)
434 DOMCI_CLASS(HTMLMediaError)
435 DOMCI_CLASS(HTMLAudioElement)
436 DOMCI_CLASS(HTMLTimeRanges)
437 #endif

So I figured that the a part of code nsHTMLTimeRanges.cpp must be
surrounded by #if defined(MOZ_MEDIA), #endif.

If I surround the whole nsHTMLTimeRanges.cpp, then the compilation/link succeeded and produced a working binary.

If I only surround the following portion,
>>      48	NS_INTERFACE_MAP_BEGIN(nsHTMLTimeRanges)
>>      49	  NS_INTERFACE_MAP_ENTRY(nsISupports)
>>      50	  NS_INTERFACE_MAP_ENTRY(nsIDOMHTMLTimeRanges)
>>      51	  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(HTMLTimeRanges)
>>      52	NS_INTERFACE_MAP_END

I get the link error half way.
../../content/html/content/src/libgkconhtmlcon_s.a(nsHTMLTimeRanges.o):
In function `~nsHTMLTimeRanges':
/home/ishikawa/TB-3HG/new-src/mozilla/content/html/content/src/nsHTMLTimeRanges.h:45:
undefined reference to `vtable for nsHTMLTimeRanges'
/usr/bin/ld: libgklayout.so: hidden symbol `vtable for nsHTMLTimeRanges'
isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[6]: *** [libgklayout.so] Error 1

I don't know if the surrounding the whole code is the right way, but
it seems to be the safe coding.
(We may want to additionally exclude the code from compilation to begin with
by excluding the source and object in Makefile. It is up to the
maintainer of the code.)



Reproducible: Always




I posted the finding and final discover that led to the successful compilation and link in mozilla.dev.builds newsgroup.

http://groups.google.co.jp/group/mozilla.dev.builds/browse_thread/thread/1d5c3f05d2af8cf9#
I needed to surround the whole code in #if defined(MOZ_MEDIA), #endif
and removed an extraneous control-M (carriage return) also.
(It was at the end of the line:
DOMCI_DATA(HTMLTimeRanges, nsHTMLTimeRanges)
Attachment #465997 - Flags: review?
Would a better fix be to change the Makefile.in so nsHTMLTimeRanges.cpp is only included if MOZ_MEDIA is defined?
(In reply to comment #2)
> Would a better fix be to change the Makefile.in so nsHTMLTimeRanges.cpp is only
> included if MOZ_MEDIA is defined?

I suppose so, but at the same time, it may not hurt to
leave the #if defined(MOZ_MEDIA), #endif in nsHTMLTimeRanges.cpp
just to be safe. But again other maintainers may have different opinions.

To me, whatever works is OK. (I have other bugs that I wanted to debug.)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Given that other files are already ifdef-ed in Makefile.in, doing this one the same way seems like the right thing.
Comment on attachment 465997 [details] [diff] [review]
Surrounding nsHTMLTimeRanges.cpp in #if defined(MOZ_MEDIA)

We should change the makefile to not compile timeranges when MOZ_MEDIA is disabled, as we do with the other media related files.
Attachment #465997 - Flags: review? → review-
We also need to #ifdef out an include in nsContentUtils.cpp. Builds work with --disable-wave, --disable-webm, and --disable-ogg, and combinations thereof.

There does not seems to be a --disable-raw. In fact it looks like raw video can't be disabled, and its configure section doesn't ensure MOZ_MEDIA is defined, so raw video will only be enabled when some other media type is enabled and that sets MOZ_MEDIA. i.e. If we build with --disable-wave, --disable-webm, and --disable-ogg, despite the fact that MOZ_RAW will still be defined, and the pref media.raw.enabled will be true, raw support won't be built because MOZ_MEDIA isn't defined. I'll file another big for this.
Assignee: nobody → chris
Attachment #465997 - Attachment is obsolete: true
Attachment #468179 - Flags: review?(chris.double)
Attachment #468179 - Flags: review?(chris.double) → review+
Comment on attachment 468179 [details] [diff] [review]
Patch: Fix so build with disable webm/ogg/wave works.

Can we have approval2.0 for this patch please? It would be nice if FF4 was able to be built with --disable-{ogg,wave,webm}, it may be useful downstream.
Attachment #468179 - Flags: approval2.0?
http://hg.mozilla.org/mozilla-central/rev/894a305625c2
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b5
(In reply to comment #5)
> Comment on attachment 465997 [details] [diff] [review]
> Surrounding nsHTMLTimeRanges.cpp in #if defined(MOZ_MEDIA)
> 
> We should change the makefile to not compile timeranges when MOZ_MEDIA is
> disabled, as we do with the other media related files.

Thank you for the explanation. I am glad that the bug is addressed properly by people in the know.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: