| Index: mojom/generators/c/templates/type_table.tmpl.go
|
| diff --git a/mojom/generators/c/templates/type_table.tmpl.go b/mojom/generators/c/templates/type_table.tmpl.go
|
| index c8cbe538d906e6d94c1a329309305c07678e82a9..c20d7e8edebda9a20ab5753eae67d93244eb3ff2 100644
|
| --- a/mojom/generators/c/templates/type_table.tmpl.go
|
| +++ b/mojom/generators/c/templates/type_table.tmpl.go
|
| @@ -4,6 +4,9 @@
|
|
|
| package templates
|
|
|
| +// These declarations go in the header file so that we can avoid some
|
| +// circular-dependencies. We call these "public" to say that other types can
|
| +// refer to them.
|
| const GenerateTypeTableDeclarations = `
|
| {{define "GenerateTypeTableDeclarations"}}
|
| {{range $union := .PublicUnionNames -}}
|
| @@ -18,34 +21,52 @@ extern struct MojomPointerTableStructEntry {{$struct}}[];
|
|
|
| const GenerateTypeTableDefinitions = `
|
| {{define "GenerateTypeTableDefinitions"}}
|
| +// Declarations for array type entries.
|
| {{range $array := .Arrays -}}
|
| -static struct MojomPointerTableArrayEntry {{$array.Name}} = {
|
| - {{$array.ElemTable}}, {{$array.NumElements}}, {{$array.Nullable}},
|
| - {{$array.ElemType}},
|
| -};
|
| +static struct MojomPointerTableArrayEntry {{$array.Name}};
|
| +{{end -}}
|
| +
|
| +// Declarations for struct type tables.
|
| +{{range $struct := .Structs -}}
|
| +struct MojomPointerTableStructEntry {{$struct.Name}}[];
|
| {{end -}}
|
|
|
| +// Declarations for union type tables.
|
| {{range $union := .Unions -}}
|
| -struct MojomPointerTableUnionEntry {{$union.Name}}[] = {
|
| -{{- range $entry := $union.Entries}}
|
| - {
|
| - {{$entry.ElemTable}}, {{$entry.Tag}},
|
| - {{$entry.Nullable}}, {{$entry.ElemType}}, {{$entry.KeepGoing}},
|
| - },
|
| +struct MojomPointerTableUnionEntry {{$union.Name}}[];
|
| {{end -}}
|
| +
|
| +// Array type entry definitions.
|
| +{{range $array := .Arrays -}}
|
| +static struct MojomPointerTableArrayEntry {{$array.Name}} = {
|
| + {{$array.ElemTable}}, {{$array.NumElements}},
|
| + {{$array.ElemType}}, {{$array.Nullable}},
|
| };
|
| -{{end}}
|
| +{{end -}}
|
|
|
| +// Struct type table definitions.
|
| {{range $struct := .Structs -}}
|
| struct MojomPointerTableStructEntry {{$struct.Name}}[] = {
|
| {{- range $entry := $struct.Entries}}
|
| {
|
| - {{$entry.ElemTable}}, {{$entry.Offset}},
|
| - {{$entry.Nullable}}, {{$entry.ElemType}}, {{$entry.KeepGoing}},
|
| + {{$entry.ElemTable}}, {{$entry.Offset}}, {{$entry.MinVersion}},
|
| + {{$entry.ElemType}}, {{$entry.Nullable}}, {{$entry.KeepGoing}},
|
| },
|
| {{end -}}
|
| };
|
| {{end -}}
|
|
|
| +// Union type table definitions.
|
| +{{range $union := .Unions -}}
|
| +struct MojomPointerTableUnionEntry {{$union.Name}}[] = {
|
| +{{- range $entry := $union.Entries}}
|
| + {
|
| + {{$entry.ElemTable}}, {{$entry.Tag}}, {{$entry.ElemType}},
|
| + {{$entry.Nullable}}, {{$entry.KeepGoing}},
|
| + },
|
| +{{end -}}
|
| +};
|
| +{{end}}
|
| +
|
| {{end}}
|
| `
|
|
|