Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: mojom/generators/c/templates/source.tmpl.go

Issue 2074923002: Mojom C Generator: Small fixes to get generated C bindings to compile. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package templates 5 package templates
6 6
7 const GenerateSourceFile = ` 7 const GenerateSourceFile = `
8 {{- define "GenerateSourceFile" -}} 8 {{- define "GenerateSourceFile" -}}
9 // This file was auto-generated by the C bindings generator. 9 // This file was auto-generated by the C bindings generator.
10 10
11 #include "{{.HeaderFile}}" 11 #include "{{.HeaderFile}}"
12 12
13 #include <stdbool.h> 13 #include <stdbool.h>
14 14
15 #include "mojo/public/c/bindings/mojom/buffer.h" 15 #include "mojo/public/c/bindings/lib/type_table.h"
16 #include "mojo/public/c/bindings/mojom/array.h"
17 #include "mojo/public/c/bindings/mojom/map.h"
18 #include "mojo/public/c/bindings/mojom/string.h"
19 #include "mojo/public/c/bindings/mojom/table.h"
20 #include "mojo/public/c/bindings/mojom/types.h"
21 #include "mojo/public/c/system/handle.h" 16 #include "mojo/public/c/system/handle.h"
22 17
23 // Imports. 18 // Imports.
24 {{range $import := .Imports -}} 19 {{range $import := .Imports -}}
25 #include "{{$import}}" 20 #include "{{$import}}"
26 {{end}} 21 {{end}}
27 22
28 // Type tables definitions for structs, arrays and unions. 23 // Type tables definitions for structs, arrays and unions.
29 {{template "GenerateTypeTableDefinitions" .TypeTable}} 24 {{template "GenerateTypeTableDefinitions" .TypeTable}}
30 25
(...skipping 12 matching lines...) Expand all
43 38
44 // Interface level constants: 39 // Interface level constants:
45 {{range $interface := .Interfaces -}} 40 {{range $interface := .Interfaces -}}
46 {{range $const := $interface.Constants -}} 41 {{range $const := $interface.Constants -}}
47 const {{$const.Type}} {{$const.Name}} = {{$const.Value}}; 42 const {{$const.Type}} {{$const.Name}} = {{$const.Value}};
48 {{end -}} 43 {{end -}}
49 {{end -}} 44 {{end -}}
50 45
51 {{end}} 46 {{end}}
52 ` 47 `
OLDNEW
« no previous file with comments | « mojom/generators/c/templates/header.tmpl.go ('k') | mojom/generators/c/templates/type_table.tmpl.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698