Closed Bug 82981 Opened 23 years ago Closed 23 years ago

nsComponentManagerUtils.h missing "#include <nsIFactory.h>"

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID
mozilla1.0

People

(Reporter: sam, Assigned: dougt)

References

Details

Attachments

(1 file)

Parameters of type "nsIFactory" are declared in nsComponentManagerUtils.h, but nowhere are any files #included that define that type. Same for type nsIComponentManger. The problem can be fixed very simply by adding two lines near the top of the file: #include <nsIFactory.h> #include <nsIComponentManager.h> Reproducible: Always Steps to Reproduce: 1. echo "#include <nsComponentManagerUtils.h>" > foo.cpp 2. c++ -I/mozilla/dist/include foo.cpp -o foo Actual Results: /sothis/projects1/mozilla/mozilla-0.8.1-debug-enabled/dist/include/nsComponentMa nagerUtils.h:38: type specifier omitted for parameter This may be related, but I think line 26 in the same file should be changed from: #ifndef OBSOLETE_MODULE_LOADING to: #ifdef OBSOLETE_MODULE_LOADING since the code it wraps is the obsolete module loading code.
Attached patch Trivial patchSplinter Review
Status: UNCONFIRMED → NEW
Ever confirmed: true
The patch posted removes those two lines, I believe. What is the problem caused by the absence of the code described above?
Bugger! I got the patch ****-backwards. Without those two headers included, nsIFactory and nsIComponentManager aren't declared anywhere. They are used in nsComponentManagerUtils.h, so they need to be declared. I only see this problem compiling non-Mozilla code. In every case where it counts, Mozilla code has obviously already included, directly or indirectly, nsIFactory.h and nsIComponentManager.h before including nsComponentManagerUtils.h. That's not the correct solution though.
I don't have an opinion on where these includes should be. But, do NOT checkin #includes that use angle brakets for non system #includes. Use double quotes. Angle brakets here would bust some platforms.
reassign all kandrot xpcom bug.
Assignee: kandrot → dougt
Blocks: 98278
Target Milestone: --- → mozilla1.0
Keywords: mozilla1.0
I believe this to be invalid now after my component manager change. Now, nsComponentManagerUtils.h include nsComponentManagerObsolete.h which forward declares nsIFactory. marking invalid
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: