Closed Bug 2841 Opened 26 years ago Closed 26 years ago

Enumerated types are generated each time a .idl file is included

Categories

(Core :: XPCOM, defect, P2)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: scottputterman, Assigned: shaver)

Details

1. Create an .idl file that has an enumerated type. 2. Create another .idl file that includes the .idl file from step 1. 3. Run xpidl on both .idl files. 4. Notice that the generated header files both contain the enumerated type. This causes a compiler error since the enumerated type is defined multiple times.
Setting all current Open/Normal to M4.
I think this is a libIDL bug; Cc:ing andrewv.
I think this is a libIDL bug; Cc:ing andrewtv.
I think this is a libIDL bug, so I've asked andrewtv@usa.net to look into it.
It occurs to me that this means that you're putting your enums outside the interface declaration. Have you tried putting them inside? Due to the way XPConnect stores interface constants, top-level (global) enums may not be visible to scripts, so that might be another reason. (The aesthetics of nsInterface::valFoo vs nsInterface_valFoo are another plus, IMHO.)
Currently the enums are outside of the interface declaration.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
This should be fixed by an upgrade to libIDL 0.5.9, but I will again plead for you to move enums into interfaces, since XPConnect will not be able to handle global enums. The IDL Author's Guide -- coming soon to http://www.mozilla.org/scriptable/xpidl/idl-authors-guide/ -- will make a similar plea, and I may in fact teach the xpidl tool to warn when it encounters global enums or constants.
QA Contact: 3819
will mark verified assuming reporter agrees with fix
will mark verified assuming reporter agrees with fix
Status: RESOLVED → VERIFIED
didn't hear any complaining so marking verified
didn't hear any complaining so marking verified
bulk reassigning all bugs from shaver's @netscape account to his @mozill acount
Status: RESOLVED → VERIFIED
Component: xpidl → XPCOM
QA Contact: paulmac → xpcom
You need to log in before you can comment on or make changes to this bug.