Closed
Bug 1011510
Opened 11 years ago
Closed 11 years ago
Codegen.py: Add EndGuard to enum generation
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: janv, Assigned: janv)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
3.30 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
We have this enum in webidl:
enum FileMode { "readonly", "readwrite" };
Codegen.py generates FileModeBinding.h with this content:
MOZ_BEGIN_ENUM_CLASS(FileMode, uint32_t)
Readonly,
Readwrite
MOZ_END_ENUM_CLASS(FileMode)
I would like to see:
MOZ_BEGIN_ENUM_CLASS(FileMode, uint32_t)
Readonly,
Readwrite,
EndGuard
MOZ_END_ENUM_CLASS(FileMode)
So I can add a serialization helper for IPDL:
template <>
struct ParamTraits<mozilla::dom::FileMode> :
public ContiguousEnumSerializer<
mozilla::dom::FileMode,
mozilla::dom::FileMode::Readonly,
mozilla::dom::FileMode::EndGuard>
{ };
Assignee | ||
Updated•11 years ago
|
Attachment #8423870 -
Flags: review?(bzbarsky)
Comment 1•11 years ago
|
||
Comment on attachment 8423870 [details] [diff] [review]
patch
Please call it _EndGuard and add an assert in the codegen that none of the enum values collide with it.
Attachment #8423870 -
Flags: review?(bzbarsky) → review-
Assignee | ||
Comment 2•11 years ago
|
||
Assignee: nobody → Jan.Varga
Attachment #8423870 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8424008 -
Flags: review?(bzbarsky)
Comment 3•11 years ago
|
||
Comment on attachment 8424008 [details] [diff] [review]
patch
r=me if you make it
'Enum value "' + value + '" cannot be used because it collides with our internal EndGuard_ value. Please rename our internal EndGuard_ to something else'
Attachment #8424008 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•